I'm using Rails 3, on ruby 1.8.7. And using for auth. devise (1.1.3). But it is a quite large community site i'm building, so i have a table for profiles and a table for users. And every time a user registers it should generate a profile also, but in devise i'm not allowed the controllers, so i'm completely lost..
Edit
Now it says
undefined method `getlocal' for Tue, 28 Dec 2010 11:18:55 +0000:DateTime
Then when i make a file in lib called date_time.rb with this code
class DateTime
def getlocal
"it works"
end
end
And require it in my Application controller it gives me this
fail wrong number of arguments (1 for 0)
it is like it don't know anything called devise anymore, but in my routes i do have devise
devise_for :users
You can subclass the Devise RegistrationsController and add your own logic in the create() method, and call the parent class methods for everything else.
If you want to customise the Devise views that are packaged inside the Gem then you can run the following command to generate the view files for your app:
You will also need to tell the router to use your new controller; something like:
There's not really any need to involve the controller in this; models can (and should) do all of the heavy lifting here.
I'm assuming that you have a relationship between
User
andProfile
models, in which case, you should just be able to do something like this: