Class: Tim::TargetImagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Tim::TargetImagesController
- Defined in:
- app/controllers/tim/target_images_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#destroy ⇒ Object
DELETE /target_images/1 DELETE /target_images/1.xml.
- #edit ⇒ Object
-
#factory_keys ⇒ Object
TODO Add factory permission check.
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/tim/target_images_controller.rb', line 29 def create @target_image = TargetImage.new(params[:target_image]) unless defined? @target_image if @target_image.save flash[:notice] = 'Image version was successfully created.' end respond_with(@target_image, @respond_options) end |
#destroy ⇒ Object
DELETE /target_images/1 DELETE /target_images/1.xml
47 48 49 50 51 |
# File 'app/controllers/tim/target_images_controller.rb', line 47 def destroy @target_image = Tim::TargetImage.find(params[:id]) unless defined? @target_image @target_image.destroy respond_with(@target_image, @respond_options) end |
#edit ⇒ Object
24 25 26 27 |
# File 'app/controllers/tim/target_images_controller.rb', line 24 def edit @target_image = Tim::TargetImage.find(params[:id]) unless defined? @target_image respond_with(@target_image, @respond_options) end |
#factory_keys ⇒ Object
TODO Add factory permission check
54 55 56 57 58 59 60 |
# File 'app/controllers/tim/target_images_controller.rb', line 54 def factory_keys if params[:target_image][:percent_complete] && params[:target_image][:status_detail][:activity] params[:target_image] = { :progress => params[:target_image][:percent_complete], :status_detail => params[:target_image][:status_detail][:activity], :status => params[:target_image][:status] } end end |
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/tim/target_images_controller.rb', line 9 def index @target_images = Tim::TargetImage.all unless defined? @target_images respond_with(@target_images, @respond_options) end |
#new ⇒ Object
19 20 21 22 |
# File 'app/controllers/tim/target_images_controller.rb', line 19 def new @target_image = Tim::TargetImage.new unless defined? @target_image respond_with(@target_image, @respond_options) end |
#show ⇒ Object
14 15 16 17 |
# File 'app/controllers/tim/target_images_controller.rb', line 14 def show @target_image = Tim::TargetImage.find(params[:id]) unless defined? @target_image respond_with(@target_image, @respond_options) end |
#update ⇒ Object
37 38 39 40 41 42 43 |
# File 'app/controllers/tim/target_images_controller.rb', line 37 def update @target_image = Tim::TargetImage.find(params[:id]) unless defined? @target_image if @target_image.update_attributes(params[:target_image]) flash[:notice] = 'Target image was successfully updated.' end respond_with(@target_image, @respond_options) end |