On Thu, Dec 25, 2008 at 5:55 PM, Pierce <[email protected]> wrote:
> > Hi everyone. > > I am really new to Ruby on Rails, so I apologize if this is a really > simple question but I just can't think of how I could do this. I want > there to be a button that will add a drop down menu to the screen, and > then depending on what the user selects it will add either a text > field or a text "area" it will add the selected one to the right of > the menu. Also, the user would have to be allowed to delete certain > "fields" as well. Then when the user submits the form Ruby on Rails > will be able to see how many menus were made as well as read what the > user put in all of them. I hope this makes sense, but if it doesn't, > just ask for clarification. :) > > If anyone could help, it would be great. > Hello Peirce, I am a newbie myself, so take any ideas I give you with a great big grain of salt, but I think you have two options here: 1) Instead of a button, use a link. Then, when the user clicks on the link, your controller could gather the information submitted (such as what was selected) and redirect the browser to a new page which would present the same information plus either a text field or a text area. This has the benefit of simplicity and sticks with what you probably already know (hopefully), but it will be somewhat clunky and look different than the more modern way of doing what you describe. 2) The more modern way of doing what you describe is to use JavaScript and AJAX to dynamically render new portions of your page dependent upon what the user has entered so far. This has the benefit of looking very slick when done well, but requires that you learn something about JavaScript and AJAX. Fortunately, there are a lot of resources (in the form of web pages with tutorials as well as a plethora of books at your local technical bookstore). Hopefully, these couple of ideas will get you thinking in one direction or another. --wpd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

