a = MyController.new.view_class.new
a.send(‘initialize_current_url’)
vx = MyController.view_class.new(StudentProfilesController.view_root,
{}, a)
vx.link_to(:controller => ‘test’, :action => ‘test’)
but because half the internals are not initialized it doesn’t work.
Would trying to simulate the request and response parameters?
ActionController::Base
def process(request, response, method = :perform_action, *arguments) #:nodoc:
That allows you to run view helper methods… specifically I’d like to
be able to access view helper methods + route helpers edit_projects and
be able to use url_for and link_to.
I still haven’t worked out a way to do this… i’m wondering if i’ll need
to reimplement the process function of actioncontroller.base
That allows you to run view helper methods… specifically I’d like to
be able to access view helper methods + route helpers edit_projects
and
be able to use url_for and link_to.
link_to is a view helper as is one version of url_for. You just need
to figure out which modules to include (hint: search through the rails
code base for the functions you would like to be accessible)
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.