Hi to all,
i have installed authlogic as shown in this tutorial DIXIS authlogic on rails3.
The fields i have used are t_login, t_password, t_name,
t_password_salt, t_persistence_token.
Uninitialized constant usually means that the the module hasn’t been
loaded into the Rails environment. Adding an initializer file might fix
it, but it seems to me that this shouldn’t be necessary with Authlogic.
Make sure you’re using the most updated version of Authlogic.
Is there a t_login column in the UserSession table?
Are you sure? Did you remember to run the migration to add it?
If the answer is yes then please post schema.rb and user_session.rb
If that is large then use pastie.org
Hi,
My project does not have an authlogic.rb file to write the require
“authlogic” line…
What i have done is i have installed authlogic in the gemfile using
gem ‘authlogic’, :git => ‘git://github.com/odorcicd/
authlogic.git’, :branch => ‘rails3’. Then i run the command bundle
install and i didn’t got any errors.
I have created from scratch a new application and now i get the
following errors:
NoMethodError in User_sessions#new
Showing G:/…/AuthlogicTest/app/views/user_sessions/new.html.erb
where line #6 raised:
Model UserSession does not respond to t_login
Extracted source (around line #6):
When i comment out the text and password field i see the form but with
no fields.
I havent found a sollution yet. I googled the problem but nothing.
Any other idea??
That’s ok (I had forgotten how authlogic works).
Lets try again then
Why have you got t_login and t_password in your view? Should it not
just be :login and :password?
Hi colin,
i have used these names because i have already created a php
application using these names and i want to create the same
application in rails.
Its for a project in my university.
I dont want to have different field names …
Do you think the problem is the names??? I dont think so…
Hi colin,
as i have seen, authlogic does require default names like login,
password
etc. I was using t_login and t_password as i result getting these
errors.
I re-created my table with the new fields and everything works fine!!!
Home that helps someone else getting the same errors!!!
On Nov 29, 2010, at 11:58 PM, Konstantinos L. wrote:
Hi colin,
as i have seen, authlogic does require default names like login, password etc. I
was using t_login and t_password as i result getting these errors.
I re-created my table with the new fields and everything works fine!!!
You can also tell authlogic what fields to use if you don’t want to
rename it… either way…
Please don’t top post, it makes it difficult to follow the thread.
Insert your reply into the previous post. Thanks
Hi colin,
i have used these names because i have already created a php
application using these names and i want to create the same
application in rails.
Its for a project in my university.
I dont want to have different field names …
Do you think the problem is the names??? I dont think so…
Well the error message is NoMethodError, Model UserSession does not
respond to t_login which is saying the UserSession does not have a
method t_login, which suggests to me that the name is the problem.
Have you done something somewhere else in your code to tell Authlogic
to expect the different names?
It is easy enough to see if this is the problem here, just change
those few lines of code and see if that error goes away.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.