Skip to content

Instantly share code, notes, and snippets.

@kalleth
Created January 4, 2012 12:37
Show Gist options
  • Save kalleth/1559867 to your computer and use it in GitHub Desktop.
Save kalleth/1559867 to your computer and use it in GitHub Desktop.
new contactcontroller for Znow
class ContactController < ApplicationController
def new
@message = Message.new
end
def create
@message = Message.new(params[:message])
if @message.valid?
Contact.contact(@message).deliver
redirect_to root_path, :notice => "Din email blev sendt, vi kontakter dig."
else
render :new, :error => "Din email blev ikke sendt."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment