How can I use a helper path inside of a form_for tag?

205 views Asked by At

I have two view files that can log someone in. One is a new.html.erb file inside of users, and this makes an entirely new user and logs them in. On the login page, I have a form that begins with <%= form_for @user ... %> but when that's submitted it will have a route request of "POST /users". I want it to either "POST /signin" or at least I want to fit signin_path inside the form, but I don't know where or how

1

There are 1 answers

0
Carlo Osores On

You can send a url parameter and a method parameter, with the signin_path and the method Post in your form_for.

<%= form_for @user, url: signin_path, method: :post do |f| %>