Controller unable to access model in production

25 views
Skip to first unread message

Cameron Craig

unread,
Jan 2, 2014, 6:06:53 PM1/2/14
to rubyonra...@googlegroups.com
I am trying to launch my rails app but when i launch the server in production mode my sessions controller cannot access my user controller. How do I fix this relationship not being set?

The problem is, in my sessions controller I can't instantiate User (e.g. User.find.authenticate (for has_secure_password))

Any ideas??

iShoeYou

unread,
Jan 3, 2014, 3:21:30 AM1/3/14
to rubyonra...@googlegroups.com
I am trying to launch my rails app but when i launch the server in production mode my sessions controller cannot access my user controller. How do I fix this relationship not being set?

The problem is, in my sessions controller I can't instantiate User (e.g. User.find.authenticate (for has_secure_password))

Any ideas??

I think you mean that your SessionsController cannot access your User model. 

It should have access to your User model, so, what error/output do you see in your development.log?

By the way the example you are providing isn't a valid Rails statement: User.find needs an argument, so it has to be something like: User.find(id).authenticate at least.

Frederick Cheung

unread,
Jan 3, 2014, 4:40:44 AM1/3/14
to rubyonra...@googlegroups.com

On Thursday, January 2, 2014 11:06:53 PM UTC, Cameron Craig wrote:
I am trying to launch my rails app but when i launch the server in production mode my sessions controller cannot access my user controller. How do I fix this relationship not being set?

The problem is, in my sessions controller I can't instantiate User (e.g. User.find.authenticate (for has_secure_password))

 
There is no relationship between controllers. What exactly happens (eg what exception is thrown) ?

Fred 
Reply all
Reply to author
Forward
0 new messages