Class: Admin::ImagesController
Instance Method Summary
collapse
#posts
#current_user, #signed_in?, #url
Instance Method Details
#create ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/ecrire/app/controllers/admin/images_controller.rb', line 10
def create
@image = post. || post.
unless @image.update(image_params)
render 'errors', status: 500
end
end
|
#destroy ⇒ Object
18
19
20
21
|
# File 'lib/ecrire/app/controllers/admin/images_controller.rb', line 18
def destroy
@image = post.
@image.clear!
end
|
#index ⇒ Object
3
4
5
6
7
8
|
# File 'lib/ecrire/app/controllers/admin/images_controller.rb', line 3
def index
@images = post.images
respond_to do |format|
format.js
end
end
|