| Ruby on rails: acts_as_authenticated and current_user in a model |
| woensdag, 12 september 2007 | |
|
I'm doing lots of Ruby on Rails development lately. I installed acts_as_authenticated to create a login for my newest project. But I also wanted to add automagically updated_by and created_by fields for my models. I used usermonitor.rb for this. But usermonitor expects you to have: User.current_user. But `helaas`, this method doesn't exist. So I had to add it. This is what I did:
And in my User-model I added:
Worked like a charm! |
| < Prev | Next > |
|---|