So this is a question that I keep trying to think through in my head and it's the first time I've had to implement it in an application. I come from a Visual Foxpro background and when I would want to add a button to a form I could simply place it on the form and then modify the clickevent with my custom code for that button.
In rails if I'm working on the New or Edit form I want to add a button that finds the last record in the table, take the account number, and then increment it by one and then replace the contents of the account field on my form with that new number. Here's my question.... Do I add a separate method in my controller simply for this button (ie increment_account) or something like that? If I do this, how do I call that from my view? Do I always call it within a form by itself? This are fairly general questions, and probably ones I should know the answer to, but I'm finding that I'm not entirely sure how to implement little buttons that do special things within the "new" or "edit" views. If someone has the time to give me an example that would be awesome . I just want to know the proper way to implement something like this.. Thanks! Chris --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

