Permalink
Browse files

Update to latest SimpleForm

  • Loading branch information...
1 parent f34d1bd commit b322751cc41b892737a6591c2adc968b70c16122 @rafaelfranca committed Feb 16, 2012
Showing with 22 additions and 22 deletions.
  1. +1 −1 Gemfile.lock
  2. +19 −19 config/initializers/simple_form.rb
  3. +2 −2 lib/templates/erb/scaffold/_form.html.erb
View
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/plataformatec/simple_form.git
- revision: da92c45953e907aed0fbb1e38477d845a7c3bc11
+ revision: e7cf7b4197b133938e4f4ba7ed973cd670ccfd47
specs:
simple_form (2.0.0.rc)
actionpack (~> 3.0)
@@ -41,41 +41,41 @@
## Inputs
b.use :label_input
- b.use :hint, :tag => :span, :class => :hint
- b.use :error, :tag => :span, :class => :error
+ b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
+ b.use :error, :wrap_with => { :tag => :span, :class => :error }
end
config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
b.use :placeholder
- b.use :label, :class => 'control-label'
- b.use :tag => 'div', :class => 'controls' do |ba|
+ b.use :label
+ b.wrapper :tag => 'div', :class => 'controls' do |ba|
ba.use :input
- ba.use :error, :tag => 'span', :class => 'help-inline'
- ba.use :hint, :tag => 'p', :class => 'help-block'
+ ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
+ ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
end
config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
b.use :placeholder
- b.use :label, :class => 'control-label'
- b.use :tag => 'div', :class => 'controls' do |input|
- input.use :tag => 'div', :class => 'input-prepend' do |prepend|
+ b.use :label, :wrap_with => { :class => 'control-label' }
+ b.wrapper :tag => 'div', :class => 'controls' do |input|
+ input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
prepend.use :input
end
- input.use :hint, :tag => 'span', :class => 'help-block'
- input.use :error, :tag => 'span', :class => 'help-inline'
+ input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
+ input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end
end
config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
b.use :placeholder
- b.use :label, :class => 'control-label'
- b.use :tag => 'div', :class => 'controls' do |input|
- input.use :tag => 'div', :class => 'input-append' do |append|
+ b.use :label, :wrap_with => { :class => 'control-label' }
+ b.wrapper :tag => 'div', :class => 'controls' do |input|
+ input.wrapper :tag => 'div', :class => 'input-append' do |append|
append.use :input
end
- input.use :hint, :tag => 'span', :class => 'help-block'
- input.use :error, :tag => 'span', :class => 'help-inline'
+ input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
+ input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end
end
@@ -98,10 +98,10 @@
# config.error_method = :first
# Default tag used for error notification helper.
- # config.error_notification_tag = :p
+ config.error_notification_tag = :div
# CSS class to add for error notification helper.
- # config.error_notification_class = :error_notification
+ config.error_notification_class = 'alert alert-error'
# ID to add for error notification helper.
# config.error_notification_id = nil
@@ -130,7 +130,7 @@
# config.label_text = lambda { |label, required| "#{required} #{label}" }
# You can define the class to use on all labels. Default is nil.
- # config.label_class = nil
+ config.label_class = 'control-label'
# You can define the class to use on all forms. Default is simple_form.
# config.form_class = :simple_form
@@ -1,13 +1,13 @@
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
<%%= f.error_notification %>
- <div class="inputs">
+ <div class="form-inputs">
<%- attributes.each do |attribute| -%>
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
<%- end -%>
</div>
- <div class="actions">
+ <div class="form-actions">
<%%= f.button :submit %>
</div>
<%% end %>

0 comments on commit b322751

Please sign in to comment.