From: Brian Candler Date: 2008-11-17T05:34:26+09:00 Subject: Re: erb & action_view outside rails David Lewis wrote: > OK, makes sense, except... > > Your response gave me a clue to get through the requires, namely prepend > -- require 'action_controller'. But then I've still gotta deal with all > the controller infrastructure that gets pulled in, so I think your > impression is correct. If you think about it: url_for relies very heavily on the action controller routing infrastructure. For example, url_for(:controller=>:foo, :action=>:new, :id=>123) might map to /widget/new/123 or /widget/123/new depending on what map lines existed in the routes.rb file (or could not be mapped at all if there is no matching route). Furthermore, if you don't provide :controller or :action then these default to those in the current request, but standalone template generation doesn't have a concept of "current request". The following may be relevant to you: http://railscasts.com/episodes/132-helpers-outside-views It warns that many URL-related helper methods may not make sense outside of actionpack's view layer. -- Posted via http://www.ruby-forum.com/.