Forum: Ruby on Rails Linking controllers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2258c43182638a619920180e9e7de5bf?d=identicon&s=25 fernando (Guest)
on 2007-05-30 20:43
(Received via mailing list)
Newbie question.
How do I link from a view in one controller to a view in another
controller?

Cheers
Bc6c0fd7296921fb7eae416f7c9e86a1?d=identicon&s=25 David Richards (Guest)
on 2007-05-30 21:36
(Received via mailing list)
link_to "some good link", :controller => 'other_controller', :action
=> 'some_action'

If you have your routes setup w/ map.resources, you'll have a number
of helpers for that as well:

  link_to "some good link", other_models_path
  link_to "some good link", new_other_model_path
  etc.

Good luck
588ab1c0a5610a7e160a3b101abb91e6?d=identicon&s=25 MichaelLatta (Guest)
on 2007-05-30 22:24
(Received via mailing list)
redirect_to :controller => controller, :action => action

Michael
This topic is locked and can not be replied to.