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 file"*
*
*
* raise "File" + filename + "doesn't not exist" unless File.exist(filename)*
*
*
* ri = RouteImporter.find(:name => self.class.name)*
*
*
* if(ri.nil?)*
* puts "Error, file doesn't exists"*
* end*
* CSV.foreach(filename, {:col_sep => @seperator}) do |row|*
*                .*
*                .*
*                .*
*                .*
*                .*
* end*
*
*
I don't know how can I do this, I've been trying few things like :action => 
:import_route, but it doesn't work, or if maybe should I do it in another 
way? 
Any idea? Thanks!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/ISepXB_vk08J.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to