开发者

Rails devise registration

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜