4 ms·
I ran into the same problem just today: need to generate some urls within a library component and for that I need to give it the controller (which has url_for a
by oliveoil 17y ago
I ran into the same problem just today: need to generate some urls within a library component and for that I need to give it the controller (which has url_for and the other helpers). The funny thing is, I am new to rails and was thinking how to do this more cleanly and how the good guys do this (anyone?), now this guy basically says go screw yourself, purists, I'll have it global. I'll stay with my hacky solution too I think.
- aaronblohowiak 17y agoThe problem is that .to_xml doesn't belong in the model any more than .to_html would belong there. This is a presentation of data for external consumption, hence belonging in the 'v' layer of MVC.