Two part form in Rails

Posted by samuel02 on Stack Overflow See other posts from Stack Overflow or by samuel02
Published on 2012-03-26T17:19:44Z Indexed on 2012/03/26 17:29 UTC
Read the original article Hit count: 150

Filed under:
|
|

I have some two nested resources, so that a Product can have many Bookings. On one page in a different controller I want to create a new booking and since it's a "general" booking I want a select menu to appear in a modal window where the user is able to pick one of the existing products and then go to the booking page.

How can I do this?

I have no problem setting up the modal and the "New booking" page is already there. What I need is a form that generates a list of existing products, picks the selected product id and then gets /products/:product_id/bookings/new .

Any help appreciated! I realize my title does not describe my problem very good so better suggestions are highly welcome!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about forms