Created
September 5, 2014 13:58
-
-
Save ka8725/34bc4d5e81bf56956bd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateUserForm | |
include ActiveModel::Model | |
attr_accessor :email | |
attr_accessor :name | |
def initialize | |
@user = User.new | |
end | |
def attributes=(attrs) | |
@user.email = attrs[:email] | |
@email = attrs[:email] | |
@user.name = attrs[:name] | |
@name = attrs[:name] | |
end | |
def save | |
valid? && @user.save | |
end | |
end |
avsej
commented
Sep 5, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment