2

I'm pretty new to Rails, but followed the excellent suggestion/walkthrough here. I've gotten the creation of my two user types (Clients and Developers) to work successfully with Devise. However, I also want to allow both user types to edit some of their attributes after they are logged in. These attributes are also specific to their user types (client specific fields or developer specific fields).

To do this, I thought that I needed to create a custom update in user_registrations_controller which inherits from Devise::RegistrationController as would make sense. During my customization however, I realize within update I am unable to call other default methods from Devise::RegistrationController. As a sanity check, I overrode update with an exact copy of the update method as defined in the original Devise::RegistrationController and still had this issue.

More specifically, the error I receive is: undefined local variable or method 'account_update_params' for #<UserRegistrationsController:0x007fe4f0342d58>, despite account_update_params being a method in the inherited controller.

Is there a better way to edit the fields specific to my user types (client/developer) in Devise without having to customize update? Also, what is going on with this error here, as I believe I am inheriting from Devise::RegistrationController?

Any thoughts? Help and suggestions much appreciated! =)

Versions: Rails 3.2.12, ruby 1.9.3p249

4

1 回答 1

0

重新访问后,我发现了这个相关的问题。尽管这篇文章和最佳答案是特定于 Rails 4 的,但可以在 Gemfile 中找到解决方案。

将您的设计 gem 包含替换为 gem 'devise', :git => 'git://github.com/plataformatec/devise.git'

不幸的是,简单地做gem 'devise'并没有得到这个更新的版本。希望这对其他人有帮助!

于 2013-08-05T01:02:01.687 回答