Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8298797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:54:56+00:00 2026-06-08T15:54:56+00:00

I’m trying to add the field name to Devise, but when I sign up

  • 0

I’m trying to add the field "name" to Devise, but when I sign up a new user it breaks when I push submit.

I’ve made sure to run rake db:migrate and I’ve restarted my server, but I get this error:

ActiveRecord::StatementInvalid in Devise::RegistrationsController#create

NoMethodError: undefined method `name’ for nil:NilClass: INSERT INTO
“users” (“created_at”, “current_sign_in_at”, “current_sign_in_ip”,
“email”, “encrypted_password”, “last_sign_in_at”, “last_sign_in_ip”,
“name”, “pic_file_name”, “remember_created_at”,
“reset_password_sent_at”, “reset_password_token”, “sign_in_count”,
“title”, “updated_at”) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9,
$10, $11, $12, $13, $14, $15) RETURNING “id”

User Class

  class User < ActiveRecord::Base
  has_and_belongs_to_many :roles

    devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable

    attr_accessible :email, :password, :password_confirmation, :remember_me, :role_ids, :name, :title, :pic_file_name
    has_one :picture, :dependent => :destroy
    accepts_nested_attributes_for :picture, :allow_destroy => true
    has_many :comments, :dependent => :destroy
    has_many :discussions, :dependent => :destroy



    def role?(role)
      roles.map(&:name).include? role.to_s
    end

  end

schema

  create_table "users", :force => true do |t|
t.string   "email",                  :default => "", :null => false
t.string   "encrypted_password",     :default => "", :null => false
t.string   "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer  "sign_in_count",          :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string   "current_sign_in_ip"
t.string   "last_sign_in_ip"
t.datetime "created_at",                             :null => false
t.datetime "updated_at",                             :null => false
t.string   "name"
t.string   "title"
t.string   "pic_file_name"
  end

New Registration View

<%= simple_form_for(resource, :as => resource_name, :html => { :multipart => true }, :html => { :class => 'form-horizontal' }, :url => registration_path(resource_name)) do |f| %>
  <%= f.error_notification %>
  <div class="row">
    <div class="span12 rounded-corners shadow inputs registration">
      <div class="row">
        <div class="span6">
          <h1>Join the Club</h1>
            <%= f.input :email, :required => true, :autofocus => true, :input_html => { :class => "span4" } %>
            <%= f.input :password, :required => true, :input_html => { :class => "span4" } %>
            <%= f.input :password_confirmation, :required => true, :input_html => { :class => "span4" } %>
            <%= f.input :name, :required => true, :input_html => { :class => "span4" } %>

            <%= f.input :title, :required => true, :input_html => { :class => "span4" } %>
            <%= f.input :pic_file_name, :as => :file, :label => "Upload Profile Picture", :required => true %>
        </div>
        <div class="span6 .hidden-phone ">
          <%= image_tag "signup.png", :class => "rounded-corners shadow signup_pic" %>
        </div>
      </div>




      <div class="row">
        <div class="signup_actions span3">
          <%= f.button :submit, "Sign up", :class => 'btn-warning btn-large' %></br >
          <%= render "links" %>
        </div>
      </div>

    <% end %>

  </div>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:54:58+00:00Added an answer on June 8, 2026 at 3:54 pm

    Put name after attr_accessible: in user class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.