I've got a small problem with my validation of a model. I have a user
and a user_setting table. The user has all main informations and the
user_setting - table has addional data like his first name etc. All
necessary input field are in one form and connect with field_for to the
right model. All possible input fields of the user_setting table are
saved in a configuration file. If the form will be submitted the
user_setting model check the value of the input fields with the given
informations of the configuration file. Now is my problem that message
in combination with the Globalite - plugin allways repeat
"__localization_missing__" and not the right message of the
check_settings - method. Antoher problem is that the input field of
user_setting model are not red marked in the create form.
class UserSetting < ActiveRecord::Base
belongs_to :user, :foreign_key => "user_id"
validates_presence_of :name, :message => :message_insert_name.l
validates_presence_of :setting_type, :message => "Include type"
if yaml_settings[self.setting_type][self.name]['necessary'] == 1
errors.add(self.name, :notice_no_value_set.l("Error! No value
set!")) if self.value.blank?
Has anybody some tips to solve these problems?