Class: Lines::Admin::PicturesController
- Inherits:
-
Lines::ApplicationController
- Object
- ActionController::Base
- Lines::ApplicationController
- Lines::Admin::PicturesController
- Defined in:
- app/controllers/lines/admin/pictures_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#destroy ⇒ Object
Deletes a picture.
-
#update ⇒ Object
PUT /admin/pictures/1.
Instance Method Details
#create ⇒ Object
8 9 10 |
# File 'app/controllers/lines/admin/pictures_controller.rb', line 8 def create @picture = Lines::Picture.create(picture_params) end |
#destroy ⇒ Object
Deletes a picture. Only responds to JS requests.
26 27 28 29 30 31 32 33 |
# File 'app/controllers/lines/admin/pictures_controller.rb', line 26 def destroy @picture = Lines::Picture.find(params[:id]) @picture.destroy respond_to do |format| format.js end end |
#update ⇒ Object
PUT /admin/pictures/1
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/lines/admin/pictures_controller.rb', line 13 def update @picture = Lines::Picture.find(params[:id]) respond_to do |format| if @picture.update_attributes(picture_params[:picture]) format.html { redirect_to @picture } else format.html { render action: "edit" } end end end |