I am looking to create a named route from a string and pass an object to it
I am doing partial with a local "resource"
t render :partial => "listing", :locals => {:resource => @resource}
inside _listing.html.haml I use the self.send method
self.send("#{resource.class.to_s.downcase}_path()")
this works great and creates resources called route i.e. article_path ()
but for this route you need an object traversed along the route that is. article_path (article)
I'm trying to do it
self.send("#{resource.class.to_s.downcase}_path("+resource+")")
and getting an error cannot convert the article to a string
any suggestions?
ben.m source
share