[Rails] Re: rails - 2 buttoms on a FORM

2008-11-21 Thread Frederick Cheung
On 20 Nov 2008, at 20:48, Xd Xd wrote: > > then, in my FORM there are 2 buttoms : > > first to select a file to upload buttom="Parcourir" > second to send the complete Form, buttom="ENVOYER" > > "parcourir" is for to select a file to upload > Isn't this button just going to come "for free" was

[Rails] Re: rails - 2 buttoms on a FORM

2008-11-20 Thread Damjan Rems
I guess you want to diferenciate clicks to different submit buttons. I did it like this: <%= image_submit_tag('add_16.png', :name => "action_categories/new") %> By specifiing name you can differenciate in controller which button was selected. params.each do |e| if e[0][0,7] == 'action_'

[Rails] Re: rails - 2 buttoms on a FORM

2008-11-20 Thread James Englert
You could use javascript to change the target of your form when they click either button. This can get messy though. Each different form target can have it's own validation. -Jim http://jim-rants.com/coding-blog/ On Thu, Nov 20, 2008 at 3:48 PM, Xd Xd <[EMAIL PROTECTED]>wrote: > > then, in my F