I have several questions at once:
- Added
name(string) andphone(integer) attributes to Devise. When sending a form, it gives the errors "Name can't be blank" and "Phone can't be blank", although the fields are filled. - How to replace labels (for example, translate into Russian)? When I change
:nameto:ФИО- everything is fine, but when I change the rest, it gives an error.
The form itself:
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :role => 'form'}) do |f| %> <h3>Регистрация</h3> <%= devise_error_messages! %> <div class="form-group"> <%= f.label :name %><br /> <%= f.text_field :name, autofocus: true %> </div> <div class="form-group"> <%= f.label :email %><br /> <%= f.email_field :email %> </div> <div class="form-group"> <%= f.label :phone %><br /> <%= f.text_field :phone %> </div> <div class="form-group"> <%= f.label :password %> <%= f.password_field :password, class: 'form-control' %> </div> <div class="form-group"> <%= f.label :password_confirmation %> <%= f.password_field :password_confirmation, class: 'form-control' %> </div> <%= f.submit 'Sign up', :class => 'button right' %> <% end %>