Forum: Ruby on Rails sumbitting a form to different controller

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
803ad415efcdcbf09b1addeb319650d7?d=identicon&s=25 Adam Akhtar (thegeezer3)
on 2009-01-21 07:38
for multi model projects which have their own controllers and views plus
forms for editing and adding objects, how do you incorporate two
different models forms in one view

for example on a todo lists main hub (e.g. hub controller) index view
you could have a form for "Add new project" and another one "Add a task"

When the user clicks the submit button for one form it will go back to
the hubs index controller with the input.

How would you get that information to say the "Project" controller`s -
"add" action.

Do you order the post command to go directly to the project controller
from the view, bypassing the hub index action OR do you go to the hub
action index and redirect from there?

If so how do i pass the forms params to the project controller as i
believe the other controller cant see the values stored in params (it
came up as nil for me when experimenting)

I have googled for this and found things slighly related but which do
not answer my question. If anyone could help that would be great!
803ad415efcdcbf09b1addeb319650d7?d=identicon&s=25 Adam Akhtar (thegeezer3)
on 2009-01-21 08:47
solved, just found out about the url parameter for form_for. I can now
submit the form to any controller action i like woohoo
This topic is locked and can not be replied to.