authlogic icon indicating copy to clipboard operation
authlogic copied to clipboard

undefined method `column_for_attribute'

Open hgspch opened this issue 17 years ago • 1 comments

Hi, I implemented the tutorial, with 'username' as the login field. The column in the Users table is named 'username', and in user.rb I added: acts_as_authentic do |c| c.login_field = :username end

and got this weird exception:

NoMethodError in User_sessions#new

Showing app/views/user_sessions/new.html.erb where line #33 raised:

undefined method `column_for_attribute' for #<UserSession: no credentials provided>

Extracted source (around line #33):

30: <%= f.label t('user.username') %> : 31: 32: 33: <%= f.text_field :username %>

34: 35: 36:

RAILS_ROOT: /disk1/home/slugs/34794_f1a214e_a88e/mnt Application Trace | Framework Trace | Full Trace

/disk1/home/slugs/34794_f1a214e_a88e/mnt/vendor/plugins/delocalize/lib/delocalize/rails_ext/action_view.rb:11:in to_input_field_tag' /disk1/home/slugs/34794_f1a214e_a88e/mnt/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:531:intext_field'

/disk1/home/slugs/34794_f1a214e_a88e/mnt/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:930:in send' /disk1/home/slugs/34794_f1a214e_a88e/mnt/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:930:intext_field'

/disk1/home/slugs/34794_f1a214e_a88e/mnt/app/views/user_sessions/new.html.erb:33:in _run_erb_app47views47user_sessions47new46html46erb' /disk1/home/slugs/34794_f1a214e_a88e/mnt/app/views/user_sessions/new.html.erb:26:in_run_erb_app47views47user_sessions47new46html46erb'

This only appends in production, it works well in development.

hgspch avatar Nov 19 '09 13:11 hgspch

Solved. It was a plugin that was present in prod ('delocalize') and not in dev. The app being deployed on Heroku, there is no visible file system. To remove it fully, remove it from the local git: git rm -r vendor/plugins/delocalize Then redeploy on Heroku.

hgspch avatar Nov 20 '09 10:11 hgspch