Added error class as configuration option on setup
This commit is contained in:
parent
7480184056
commit
5c1db60dfd
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue