Does form_tag work with Simple_form?

You can use simple_form even if you aren’t creating a form that’s tied to a model.

Take this signin form as an example:

<%= simple_form_for :signin, { url: signin_path } do |f| %>
  <%= f.input :email %>
  <%= f.input :password %>
  <%= f.button :submit, "Sign In" %>
<% end %>

That will generate params like the following:

{
  ...
  "signin" => {
    "email"=>"test@test.com",
    "password"=>"[FILTERED]"},
    "commit"=>"Sign In"
   }
 }

In your controller you can reference the form fields using:

params[:signin][:email] ...

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)