开发者

Rails devise registration

开发者 https://www.devze.com 2023-04-08 05:54 出处:网络
How can I modify attributes of User instance before save in custom registrations controller, inherited from Devise::Registrations开发者_开发问答Controller?You gave the answer yourself. In your model d

How can I modify attributes of User instance before save in custom registrations controller, inherited from Devise::Registrations开发者_开发问答Controller?


You gave the answer yourself. In your model do:

class User < ActiveRecord::Base
    before_save :set_attributes

    def set_attributes
       // Change the attributes to what you like
    end
end
0

精彩评论

暂无评论...
验证码 换一张
取 消