Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement hints.

  • Loading branch information...
commit e2cc8bc3a95c30c471dd692cf8de431ea93b3a8f 1 parent b690891
@mjbellantoni authored
View
2  lib/formtastic-bootstrap/inputs/base/hints.rb
@@ -5,7 +5,7 @@ module Hints
include Formtastic::Inputs::Base::Hints
- def hint_html(inline_or_block = :inline)
+ def hint_html(inline_or_block = :block)
if hint?
hint_class = if inline_or_block == :inline
options[:hint_class] || builder.default_inline_hint_class
View
7 lib/formtastic-bootstrap/inputs/base/wrapping.rb
@@ -11,10 +11,10 @@ def bootstrap_wrapping(&block)
controls_wrapping do
if options[:prepend]
prepended_input_wrapping do
- [template.content_tag(:span, options[:prepend], :class => 'add-on'), yield].join("\n").html_safe
+ [template.content_tag(:span, options[:prepend], :class => 'add-on'), yield, hint_html].join("\n").html_safe
end
else
- yield
+ [yield, hint_html].join("\n").html_safe
end
end
end
@@ -22,14 +22,13 @@ def bootstrap_wrapping(&block)
def control_group_wrapping(&block)
template.content_tag(:div,
- [template.capture(&block), error_html, hint_html].join("\n").html_safe,
+ [template.capture(&block), error_html].join("\n").html_safe,
wrapper_html_options
)
end
def controls_wrapping(&block)
template.content_tag(:div, template.capture(&block).html_safe, controls_wrapper_html_options)
- # I think error_html and hint_html will move here.
end
def controls_wrapper_html_options
Please sign in to comment.
Something went wrong with that request. Please try again.