August Lilleaas wrote:
> Soh Dubom wrote:
>  > In the before_create I could do that
>> 
>>   def before_create
>>     self.password = User.hash_password(@password)
>>   end
>> 
>> but that will work only for web form submit!
> 
> I think you're wrong. password= is probably just an accessor, setting 
> @password. So, u.password = '123' sets @password to '123. u.password 
> returns the value of @password. password= _could_ be anything, though. 
> It depends on the implementation.

I understand password is a property of User class (as username, email 
etc). What I'm trying to explain is that through a web interface I can 
access web form variables (password, username etc) using the @ sign, eg 
: @password, or params[:password], but I'm just using the rails console 
trying to interact with a ruby class, can I do that?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to