Created
April 24, 2013 22:26
-
-
Save sergiomaia/5456120 to your computer and use it in GitHub Desktop.
Controller /action /create
This file contains 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
MessagesController /action /create | |
def create | |
message = current_user.messages.build(params[:message]) | |
message.created_at = Time.now # HACK | |
message.save! | |
respond_with(@messages, :location => messages_url) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment