Class: TaskFilesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TaskFilesController
- Defined in:
- app/controllers/task_files_controller.rb
Constant Summary
Constants included from Localization
Localization::LOCALIZED_STRINGS
Instance Method Summary collapse
Methods inherited from ApplicationController
in_place_edit_for, #initialize
Methods included from ApplicationHelper
#back_or_link_to, #detour?, #detour_to, #display_notice, #h, #image_button_to, #image_detour_to, #image_link_to, #image_link_to_remote, #insert, #record, #resolution_image, #t, #update_task, #with_detour
Methods included from Localization
#l, load_localized_strings, #valid_language?
Constructor Details
This class inherits a constructor from ApplicationController
Instance Method Details
#destroy ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/task_files_controller.rb', line 10 def destroy @task_file = TaskFile.find(params[:id]) @task_file.destroy respond_to do |format| format.html { redirect_to(:controller => 'tasks', :action => :edit, :id => @task_file.task) } format.xml { head :ok } end end |
#show ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/controllers/task_files_controller.rb', line 2 def show @task_file = TaskFile.find(params[:id]) send_data(@task_file.content_data, :disposition => @task_file.image? ? 'inline' : 'attachment', :type => @task_file.content_type, :filename => @task_file.name) end |