Skip to content

Instantly share code, notes, and snippets.

Created January 16, 2010 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/278928 to your computer and use it in GitHub Desktop.
Save anonymous/278928 to your computer and use it in GitHub Desktop.
def create
@message = Message.new(params[:message])
respond_to do |format|
if @message.save
ContactMailer.deliver_message(@message)
flash[:notice] = 'Message was successfully created.'
format.html { redirect_to(@message) }
format.xml { render :xml => @message, :status => :created, :location => @message }
else
format.html { render :action => "new" }
format.xml { render :xml => @message.errors, :status => :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment