i am new in rails , tell plz why this code does not work
i use the gem Devise for registration,
I want to let the user select his country ( with gem country_select )
and when i register new user i put the form:
<div id='maintitle'><h1>Sign up</h1></div>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
...
<div class='some_fild'>Email*<br />
<%= f.email_field :email %></div>
....
<div class='some_fild'>Confirm<br />
<%= f.password_field :password_confirmation %></div>
???? <---
<div><%= f.submit "Sign up" %></div>
I put in my ‘user’ db table column ‘country’
what string i must put instead of “????<—” to this select seva in my DB in column ‘country’ ?
i think something like that:
<%= f.country_select :country, 'select' %>
but it does not work
You need to provide the model and the attribute you want to set – on that form, your model instance is stored inside
resource, so you’d need this:I used the example from the README, which doesn’t make any mention of how to use it inside a form – I’d assume it’s the same.