Hello... I have a form with 3 buttons, each with a different functionality concerning to forum user information. Once it''s shown in the form, you can: * Modify your information * Print your info (via Prawn) * Delete the user But I only have one form, and I need every button to do a different action. Can you please help me find something to make it work? Greetings The Neurochild --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2008-Dec-16 21:53 UTC
Re: Buttons with different actions... for a single form
On Dec 16, 2008, at 4:13 PM, The Neurochild wrote:> Hello... > > I have a form with 3 buttons, each with a different functionality > concerning to forum user information. Once it''s shown in the form, you > can: > > * Modify your information > * Print your info (via Prawn) > * Delete the user > > But I only have one form, and I need every button to do a different > action. Can you please help me find something to make it work? > > Greetings > > The NeurochildThe first one is clearly a submit button, but the other two could be link_to_function, button_to_function, link_to_remote, or button_to_remote. Those wouldn''t be ''in'' the form. (Actually, the Delete the User could be a link_to(''Delete'', user_path(@user), :method => :delete, :confirm => "Really delete #{@user.name}?\n(There is no undo!)") or similar.) You can get the name of the submit input activated, too, if you need to make a choice about what happens next. (I.e., "Complete Order" or "Change Shipping Address") -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The Neurochild
2008-Dec-17 14:02 UTC
Re: Buttons with different actions... for a single form
I forgot to tell you it has to use elements of the form. The delete user could be separated from the form, but the Prawn (PDF) button functionality must have all the values of the form when something is modified. It has to be in the form is there a button_to-like function inside the form? Greetings... The Neurochild --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andrius Chamentauskas
2008-Dec-17 14:39 UTC
Re: Buttons with different actions... for a single form
Can''t you just refetch user info from the database? On Dec 17, 4:02 pm, The Neurochild <neuroch...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I forgot to tell you it has to use elements of the form. The delete > user could be separated from the form, but the Prawn (PDF) button > functionality must have all the values of the form when something is > modified. It has to be in the form is there a button_to-like function > inside the form? > > Greetings... > > The Neurochild--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---