Class: Cmsimple::ImagesController
- Inherits:
-
Object
- Object
- Cmsimple::ImagesController
- Defined in:
- app/controllers/cmsimple/images_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/cmsimple/images_controller.rb', line 16 def create @image = Image.new(params[:image]) @image.save respond_with @image, location: new_image_path end |
#destroy ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/cmsimple/images_controller.rb', line 22 def destroy @image = Image.find(params[:id]) @image.destroy respond_with @image end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/cmsimple/images_controller.rb', line 6 def index @images = Image.all respond_with @images end |
#new ⇒ Object
11 12 13 14 |
# File 'app/controllers/cmsimple/images_controller.rb', line 11 def new @image = Image.new respond_with @image end |