Class: Smithy::ImagesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/smithy/images_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
22
# File 'app/controllers/smithy/images_controller.rb', line 17

def create
  @image = Smithy::Image.new(filtered_params)
  @image.save
  flash.notice = "Your image was created" if @image.persisted?
  respond_with @image
end

#destroyObject



35
36
37
38
39
# File 'app/controllers/smithy/images_controller.rb', line 35

def destroy
  @image = Smithy::Image.find(params[:id])
  @image.destroy
  respond_with @image
end

#editObject



24
25
26
27
# File 'app/controllers/smithy/images_controller.rb', line 24

def edit
  @image = Smithy::Image.find(params[:id])
  respond_with @image
end

#newObject



12
13
14
15
# File 'app/controllers/smithy/images_controller.rb', line 12

def new
  @image = Smithy::Image.new(filtered_params)
  respond_with @image
end

#showObject



7
8
9
10
# File 'app/controllers/smithy/images_controller.rb', line 7

def show
  @image = Smithy::Image.find(params[:id])
  respond_with @image
end

#updateObject



29
30
31
32
33
# File 'app/controllers/smithy/images_controller.rb', line 29

def update
  @image = Smithy::Image.find(params[:id])
  flash.notice = "Your image was saved" if @image.update_attributes(filtered_params)
  respond_with @image
end