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
精彩评论