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



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

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
end

#destroyObject



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

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

#editObject



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

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

#indexObject



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

def index
  @base_images = Tim::BaseImage.all unless defined? @base_images
  respond_with @base_images
end

#newObject



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

def new
  @base_image = Tim::BaseImage.new
  respond_with @base_image
end

#showObject



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

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

#updateObject



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

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
end