Class: Admin::ImagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::ImagesController
- Defined in:
- app/controllers/bigmouth/admin/images_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 25 def create @image = Bigmouth::Image.new(image_params) @image.user_id = current_user.id if @image.save redirect_to admin_image_path(@image), notice: 'Image was successfully created.' else render :new end end |
#destroy ⇒ Object
44 45 46 47 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 44 def destroy @image.destroy redirect_to admin_images_url, notice: 'Image was successfully destroyed.' end |
#edit ⇒ Object
22 23 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 22 def edit end |
#index ⇒ Object
11 12 13 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 11 def index @images = Bigmouth::Image.all end |
#new ⇒ Object
18 19 20 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 18 def new @image = Bigmouth::Image.new end |
#show ⇒ Object
15 16 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 15 def show end |
#update ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/controllers/bigmouth/admin/images_controller.rb', line 36 def update if @image.update(image_params) redirect_to admin_image_path(@image), notice: 'Image was successfully updated.' else render :edit end end |