Created
January 4, 2012 12:37
-
-
Save kalleth/1559867 to your computer and use it in GitHub Desktop.
new contactcontroller for Znow
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
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