Displaying 2 results from an estimated 2 matches for "collection_action".
2012 Nov 07
0
redirect from a collection_action to another class
Hi! I''m new at ruby,I want to redirect from here in app/admin:
*collection_action :status_race, :method => :post do*
* #Do some import work..*
* redirect_to #redirect to import class*
* end *
To this class which is in app/lib/route:
*class ImportRoute*
* def initialize*
* #parametres que tinga el fitxer*
* end*
* def run(filename)*
* puts "Running route import...
2012 Nov 12
1
undefined method `original_filename' for nil:NilClass
...f.input :uploaded_data, :action => :status_race, :multipart =>
true, :as => :file %>*
* <%end%>*
* <input name=''commit'' type=''submit'' method=''post'' value=''Import''/>*
*<%end%>*
My controller:
*collection_action :status_race, :method => :post do*
*
*
* uploaded_io = params[:uploaded_data].original_filename*
*
*
* File.open(Rails.root.join(''app/importers'', ''uploads'',
uploaded_io.original_filename), ''w'') do |file|*
* file.write(uploaded_io....