Class: Tim::ImageVersionsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#render_not_found

Instance Method Details

#createObject



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

def create
  @image_version = ImageVersion.new(params[:image_version]) unless defined? @image_version
  if @image_version.save
    flash[:notice] = 'Image version was successfully created.'
  end
  respond_with(@image_version, @respond_options)
end

#destroyObject



42
43
44
45
46
# File 'app/controllers/tim/image_versions_controller.rb', line 42

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

#editObject



21
22
23
24
# File 'app/controllers/tim/image_versions_controller.rb', line 21

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

#indexObject



6
7
8
9
# File 'app/controllers/tim/image_versions_controller.rb', line 6

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

#newObject



16
17
18
19
# File 'app/controllers/tim/image_versions_controller.rb', line 16

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

#showObject



11
12
13
14
# File 'app/controllers/tim/image_versions_controller.rb', line 11

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

#updateObject



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

def update
  @image_version = Tim::ImageVersion.find(params[:id]) unless defined? @image_version
  if @image_version.update_attributes(params[:image_version])
    flash[:notice] = 'Image version was successfully updated.'
  end
  respond_with(@image_version, @respond_options)
end