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:
parent
c6cc3f2731
commit
1c44d54b51
@ -7,9 +7,9 @@ class ContactsController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
@contact = Contact.new(params[:contact])
|
@contact = Contact.new(params[:contact])
|
||||||
if @contact.save
|
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
|
else
|
||||||
flash[:alert] = "Please fill in fields marked in red."
|
flash[:alert] = t("contact.invalid")
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,4 +2,6 @@
|
|||||||
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
||||||
|
|
||||||
en:
|
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.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user