swsnu / wecfall2014

0 stars 0 forks source link

1 form 2 buttons #4

Open HaritzPuerto opened 10 years ago

HaritzPuerto commented 10 years ago

Hi all!

I've got a new doubt. I do know how to create a form knowing the model (form_for) and without the model (form_tag) but these connect one form with one action. In the login assignment specification we are asked to build just one form and 2 buttons. How can we connect each button with each action? I've got a solution but I think it's not a good one. I used a form_tag /signup and in the controller, in the create user function I check the parameters to know which button was pressed, so if the log in button was pressed, I call the funcion log_in and I don't create a user.

Thank you,

Haritz

taegeonum commented 10 years ago

I recommend you to use javascript and JQuery when you build a html5 application. Also, I recommend you to use ajax when you send a request to your server. I added some tutorials for javascript and jquery to our course website.

Good luck :)

wynot12 commented 10 years ago

@taegeonum Wow, thank you :)

bgchun commented 10 years ago

@taegeonum Thanks!

HaritzPuerto commented 10 years ago

Thank you!