<% end %>
#Note that he's using the now defunct start_from_tag
Problem is because I don't have a password field in users table in
database, I think it gives undefined method error for password when I
pass as argument in the password_field() method. However, in the book,
he does exactly that and it works for him.
<% end %>
#Note that he's using the now defunct start_from_tag
Problem is because I don't have a password field in users table in
database, I think it gives undefined method error for password when I
pass as argument in the password_field() method. However, in the book,
he does exactly that and it works for him.
Is there anything I'm doing wrong?
The example should never have worked, unless he's relying on some
particular authentication library (or an attr_accessor call) to create
the password method.
However, you're doing two things wrong here:
* Following an outdated book
* Trying to roll your own authentication library -- just go with
Authlogic or Devise.
However, you're doing two things wrong here:
* Following an outdated book
* Trying to roll your own authentication library -- just go with
Authlogic or Devise.
This is for a personal project that doesn't require rapid development.
I'm just trying to build my own authentication system so I can better
understand the Rails environment. Like you said, perhaps he's declaring
a setter and getter method of the User class with the identifier of
"password". Nevertheless nowhere is it explained how to translate this
to a password hash in this book. I looked at the Advanced Recipes book
and it doesn't cover authentication at all.