Class: Tim::BaseImagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tim/base_images_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#render_not_found

Instance Method Details

#createObject



28
29
30
31
32
33
34
# File 'app/controllers/tim/base_images_controller.rb', line 28

def create
  @base_image = Tim::BaseImage.new(params[:base_image]) unless defined? @base_image
  if @base_image.save
    flash[:notice] = "Successfully created Base Image"
  end
  respond_with(@base_image, @respond_options)
end

#destroyObject



44
45
46
47
48
# File 'app/controllers/tim/base_images_controller.rb', line 44

def destroy
  @base_image = Tim::BaseImage.find(params[:id]) unless defined? @base_image
  @base_image.destroy
  respond_with(@base_image, @respond_options)
end

#editObject



23
24
25
26
# File 'app/controllers/tim/base_images_controller.rb', line 23

def edit
  @base_image = Tim::BaseImage.find(params[:id]) unless defined? @base_image
  respond_with(@base_image, @respond_options)
end

#indexObject



8
9
10
11
# File 'app/controllers/tim/base_images_controller.rb', line 8

def index
  @base_images = Tim::BaseImage.all unless defined? @base_images
  respond_with(@base_images, @respond_options)
end

#newObject



18
19
20
21
# File 'app/controllers/tim/base_images_controller.rb', line 18

def new
  @base_image = Tim::BaseImage.new unless defined? @base_image
  respond_with(@base_image, @respond_options)
end

#showObject



13
14
15
16
# File 'app/controllers/tim/base_images_controller.rb', line 13

def show
  @base_image = Tim::BaseImage.find(params[:id]) unless defined? @base_image
  respond_with(@base_image, @respond_options)
end

#updateObject



36
37
38
39
40
41
42
# File 'app/controllers/tim/base_images_controller.rb', line 36

def update
  @base_image = Tim::BaseImage.find(params[:id]) unless defined? @base_image
  if @base_image.update_attributes(params[:base_image])
    flash[:notice] = "Successfully updated Base Image"
  end
  respond_with(@base_image, @respond_options)
end