Hi all, I'm getting the following error in my application that uses Authlogic:
ActionView::TemplateError (undefined method `password' for #<User:0x2af83ebffa98>) on line #7 of app/views/users/_form.html.erb:
4: <br />
6: <%= form.label :password, form.object.new_record? ? nil : "Change password" %><br />
7: <%= form.password_field :password %><br />
9: <br />
It works perfectly locally, but when I run it on Heroku it stops working. I see that others have this issue, but no-one has been given an answer. All of the migrations are run, and I do have acts_as_authentic in my User model.
Woops, I believe it's a problem with the order in which things are done while deploying. I pushed my code to Heroku, then I ran migrations. Pushing again restarted the application and probably got rid of the cached table names and fields.
Make sure your User class is using acts_as_authentic:
class User < ActiveRecord::Base
I did all kinds of troubleshooting and had somehow removed this when troubleshooting a different problem.
pushy, I've seen similar things. Always run a "heroku restart" after running your migrations and you should be fine.
I actually encountered this quite a bit recently with several apps and for me it was always that authLogic (or the right version for my rails 2.3.8) wasn't set in environment.rb, plus gem needs to be installed on the server at some point.
I knew it had to be config (not app code) 'cos the app. code was working locally and was the same as live.
The error is tough too because you search everywhere for that field but it's really in the gem. I use a regular ISP (Site5).