Class: Tim::ProviderImagesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#render_not_found

Instance Method Details

#createObject



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

def create
  @provider_image = ProviderImage.new(params[:provider_image]) unless defined? @provider_image
  if @provider_image.save
    flash[:notice] = 'Provider image was successfully created.'
  end
  respond_with(@provider_image, @respond_options)
end

#destroyObject



45
46
47
48
49
# File 'app/controllers/tim/provider_images_controller.rb', line 45

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

#editObject



24
25
26
27
# File 'app/controllers/tim/provider_images_controller.rb', line 24

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

#indexObject



9
10
11
12
# File 'app/controllers/tim/provider_images_controller.rb', line 9

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

#newObject



19
20
21
22
# File 'app/controllers/tim/provider_images_controller.rb', line 19

def new
  @provider_image = Tim::ProviderImage.new
  respond_with(@provider_image, @respond_options)
end

#showObject



14
15
16
17
# File 'app/controllers/tim/provider_images_controller.rb', line 14

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

#updateObject



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

def update
  @provider_image = Tim::ProviderImage.find(params[:id]) unless defined? @provider_image
  if @provider_image.update_attributes(params[:provider_image])
    flash[:notice] = 'Provider image was successfully updated.'
  end
  respond_with(@provider_image, @respond_options)
end