Reset DB and now cant create admin role!

15 views
Skip to first unread message

Dave Castellano

unread,
Jul 18, 2014, 8:01:07 PM7/18/14
to rubyonra...@googlegroups.com
Help! Stupid mistakee.... Reset database and now can't create a new
admin user!

Have seed file but get error now that using rails 4 .. Any guidance
would be appreciated as I can't even log in as admin anymore. Upgraded
to rails 4 and using Devise.

rake db:seed add the users to the table:

puts 'CREATING ROLES'
Role.create([
{ :name => 'admin' },
{ :name => 'user' },
{ :name => 'VIP' }
], :without_protection => true)
puts 'SETTING UP DEFAULT USER LOGIN'
user = User.create! :name => 'First User', :email => 'us...@example.com',
:password => 'please', :password_confirmation => 'please'
puts 'New user created: ' << user.name
user2 = User.create! :name => 'Second User', :email =>
'us...@example.com', :password => 'please', :password_confirmation =>
'please'
puts 'New user created: ' << user2.name
user.add_role :admin
user2.add_role :VIP

Can't log in with the user names and passwords ain the table and get
error:
ActionController::InvalidAuthenticityToken in
Devise::SessionsController#create
ActionController::InvalidAuthenticityToken

Thanks,
Dave Castellano

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Jul 19, 2014, 4:13:14 AM7/19/14
to rubyonra...@googlegroups.com
On 19 July 2014 01:00, Dave Castellano <li...@ruby-forum.com> wrote:
> ...
> Can't log in with the user names and passwords ain the table and get
> error:
> ActionController::InvalidAuthenticityToken in
> Devise::SessionsController#create
> ActionController::InvalidAuthenticityToken

Google yielded this which might be helpful
http://stackoverflow.com/questions/20875591/actioncontrollerinvalidauthenticitytoken-in-registrationscontrollercreate

Colin
Reply all
Reply to author
Forward
0 new messages