Skip to content

Commit

Permalink
Add support to error style
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Sep 11, 2011
1 parent 7f9866e commit ffac64e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/models/article.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class Article < ActiveRecord::Base
validates_presence_of :name
end
6 changes: 3 additions & 3 deletions config/initializers/simple_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# You can remove any component from the wrapper, change the order or even
# add your own to the stack. The options given to the wrappers method
# are used to wrap the whole input (if any exists).
config.wrappers :class => 'input clearfix', :error_class => :field_with_errors do |b|
config.wrappers :class => 'clearfix', :error_class => :error do |b|
b.use :placeholder
b.use :label
b.use :tag => 'div', :class => 'input' do |ba|
ba.use :input #, :class => 'xlarge'
ba.use :hint, :tag => :span, :class => :hint
ba.use :error, :tag => :span, :class => :error
ba.use :error, :tag => :span, :class => 'help-inline'
end
end

Expand Down Expand Up @@ -52,7 +52,7 @@

# Tell browsers whether to use default HTML5 validations (novalidate option).
# Default is enabled.
# config.browser_validations = true
config.browser_validations = false

# Determines whether HTML5 types (:email, :url, :search, :tel) and attributes
# (e.g. required) are used or not. True by default.
Expand Down

0 comments on commit ffac64e

Please sign in to comment.