question about devise
In my dumy rails project, I use devise to provide the login/out and authentication function. But I need provide the virtual user more functionalities. for example upload his 开发者_C百科avatar picture. Then problems comes. It seems that devise is confilict with the "mvc" principle, because I can't the expected user_controlle.rb , let's say I create a model user.rb.
My limited knowledge let me think like this: without the user controller I can't add the "upload avartar picture" action.
so could you tell me how to bypass the limitation of devise in my situation? thanks in advance.
Try this: https://github.com/plataformatec/devise/wiki/How-To:-Manage-users-through-a-CRUD-interface
Basically,
- Create a controller for your users
- Add
resources :users
to your routes.rb file, and make sure it's below thedevise_for :users
route - Make sure you remove
:registerable
from your model, if it's there
Note: these instructions are for Rails 3. For Rails 2, the instructions in the link above should work.
精彩评论