Class: Admin::ImagesController

Inherits:
AdminController show all
Defined in:
app/controllers/admin/images_controller.rb

Instance Attribute Summary

Attributes included from PagesCore::Authentication

#current_user

Instance Method Summary collapse

Methods inherited from PagesCore::AdminController

#redirect, underscore

Methods included from PagesCore::PoliciesHelper

#policy, #verify_policy, #verify_policy_with_proc

Methods included from PagesCore::ProcessTitler

inc_number_of_requests, original_title

Methods included from PagesCore::ErrorRenderer

#render_error

Methods included from PagesCore::Authentication

#authenticate!, #deauthenticate!, #logged_in?

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/admin/images_controller.rb', line 13

def create
  @image = Image.create(image_params)
  if @image.valid?
    respond_to do |format|
      format.json do
        render json: @image, serializer: Admin::ImageSerializer
      end
    end
  end
end

#destroyObject



31
# File 'app/controllers/admin/images_controller.rb', line 31

def destroy; end

#editObject



11
# File 'app/controllers/admin/images_controller.rb', line 11

def edit; end

#indexObject



5
# File 'app/controllers/admin/images_controller.rb', line 5

def index; end

#newObject



9
# File 'app/controllers/admin/images_controller.rb', line 9

def new; end

#showObject



7
# File 'app/controllers/admin/images_controller.rb', line 7

def show; end

#updateObject



24
25
26
27
28
29
# File 'app/controllers/admin/images_controller.rb', line 24

def update
  @image.update(image_params)
  respond_to do |format|
    format.json { render action: :show }
  end
end