Skip to content

Instantly share code, notes, and snippets.

@sergiomaia
Created April 24, 2013 22:26
Show Gist options
  • Save sergiomaia/5456120 to your computer and use it in GitHub Desktop.
Save sergiomaia/5456120 to your computer and use it in GitHub Desktop.
Controller /action /create
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