0

I have a weird problem with Error Messages. This is my class only Virtus and ActiveModel Validations. I have some validations in there. Locally on my machine everything works fine. But on the server the custom messages like 'landing.form.error.title' are not found. I get the normal key not found message from rails.

en.landing.form.error.title

The interesting part is that the not customized message is displayed correctly like for name. I commented the custom message out for name and the standard validate_presence_of message is displayed in the correct locale.

class FreeOrder
  include Virtus.model  
  include ActiveModel::Validations

  attribute :email, String
  attribute :title, String
  attribute :name, String
  attribute :newsletter, Boolean  

  validates :email, :email => {:strict_mode => true, message: I18n.t('landing.form.error.email') }  

  validates_presence_of :newsletter, message: I18n.t('landing.form.error.newsletter')
  #validates_presence_of :name, message: I18n.t('landing.form.error.name')  
  validates_presence_of :name
  validates_presence_of :title, message: I18n.t('landing.form.error.title')    

end
michael_knight
  • 4,921
  • 3
  • 17
  • 10

1 Answers1

0

ok i figured it out, the problem was that i did not have a default locale specified in application.rb

michael_knight
  • 4,921
  • 3
  • 17
  • 10