Added error class as configuration option on setup

This commit is contained in:
Johan Buts 2010-10-15 23:06:32 +08:00 committed by José Valim
parent 7480184056
commit 5c1db60dfd
3 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,9 @@ SimpleForm.setup do |config|
# CSS class to add to all hint tags.
# config.hint_class = :hint
# Default tag used on errors.
# config.error_class = :error
# Default tag used on errors.
# config.error_tag = :span

View File

@ -23,6 +23,10 @@ module SimpleForm
mattr_accessor :error_tag
@@error_tag = :span
# CSS class to add to all error tags.
mattr_accessor :error_class
@@error_class = :error
# Method used to tidy up errors.
mattr_accessor :error_method
@@error_method = :first

View File

@ -20,7 +20,7 @@ module SimpleForm
end
def error_html_options
html_options_for(:error, [:error])
html_options_for(:error, [SimpleForm.error_class])
end
protected