Module: ActionController::UploadProgress::ClassMethods

Defined in:
lib/action_controller/upload_progress.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#upload_status_for(*actions) ⇒ Object

Creates an after_filter which will call finish_upload_status creating the document that will be loaded into the hidden IFRAME, terminating the status polling forms created with form_with_upload_progress.

Also defines an action upload_status or a action name passed as the :status option. This status action must match the one expected in the form_tag_with_upload_progress helper.


202
203
204
205
206
207
208
# File 'lib/action_controller/upload_progress.rb', line 202

def upload_status_for(*actions)
  after_filter :finish_upload_status, :only => actions
  
  define_method(actions.last.is_a?(Hash) && actions.last[:status] || :upload_status) do
    render(:inline => '<%= upload_progress_status %>', :layout => false)
  end
end