I am trying to get something working and its driving me crazy. I have been looking around for solutions to getting view helpers working in models and for the most part I find this solution.
Add the following in the model you want to use them in
However, when I try something like
link_to(polymorphic_path(@node)) I get an error.
"can't convert String into Hash"
This is because 'link_to' uses 'url_for' which is a method that both UrlHelper and UrlWriter both have which actually behave differently.
so my polymorphic_path(@node) => "/nodes/1" is a string and ActionController's url_for is expecting a hash.
Has anyone seem this and found a nice clean solution, or is this just the wrong way to go about things