I'm doing auth with devise. I need also extra field name and type of user. Here is migration:
class AddColoumnToUsers < ActiveRecord::Migration
def change
add_column :users, :name, :string
add_column :users, :type, :string
end
end
And then registration field
<%=simple_form_for(resource, as: resource_name, url: registration_path(resource_name), :html => {:class => 'form-horizontal' }) do |m| %>
<%= m.input :name%>
<%=m.input :email %>
<%=m.input :password %>
<%=m.input :password_confirmation %>
<%=m.button :submit %>
<% end %>
All works fine, but after reg if i tried to welcome user by name got empty or error.
I do like this in profile
<%= current_user.name %>
The error is no method error or if i add @ just return empty field. Can anyone help?