When using the utility, I continue to get this error when I try to load the registration page with a new "username" field
undefined method `username' for #<User:0x007f8c8e347f48>
This happens when registering:
3: <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: 'form-horizontal'}) do |f| %> 4: <%= f.error_notification %> 5: 6: <%= f.input :username %> 7: <%= f.input :email %> 8: <%= f.input :password %> 9: <%= f.input :password_confirmation %>
This is in user.rb models
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :username, :email, :password, :password_confirmation, :remember_me # attr_accessible :title, :body end
To configure it, I placed the following commands through the terminal:
rails generate migration AddUsernameToUsers username:string bundle exec rake db:migrate
Through the previous questions, I add these commands through the terminal:
rake db:schema:load
The error does not even allow me to access the page. Unlike other questions, when does this happen after clicking a button.
Edit
After rebooting my server several times, it automatically issues a local server with this error:
Called from: /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack- 3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'. Exiting /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:469:in `load': /Users/hunter/first_app/app/models/view.rb:11: syntax error, unexpected keyword_end (SyntaxError)
Edit
This is in /view.rb models:
class View < ActiveRecord::Base # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :username, :email, :password, :password_confirmation, :remember_me, # attr_accessible :title, :body end
Edit
I removed the comma at the end: remember_me in /view.rb models and now the server is working. Now I can upload it to localhost: 3000. However, when I click on the registration page, I get the same error as before.