1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Move flash messages to locale.

This commit is contained in:
Dan Barber 2013-06-02 22:18:52 +01:00
parent c6cc3f2731
commit 1c44d54b51
2 changed files with 5 additions and 3 deletions

View File

@ -7,9 +7,9 @@ class ContactsController < ApplicationController
def create
@contact = Contact.new(params[:contact])
if @contact.save
redirect_to(:new_contact, :notice => "Thanks for your email, I'll be in touch as soon as possible.")
redirect_to(:new_contact, :notice => t("contact.thanks"))
else
flash[:alert] = "Please fill in fields marked in red."
flash[:alert] = t("contact.invalid")
render :new
end
end

View File

@ -2,4 +2,6 @@
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
contact:
thanks: Thanks for your email, I'll be in touch as soon as possible.
invalid: Please fill in fields marked in red.