Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
Implement hints.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Bellantoni committed Sep 4, 2012
1 parent b690891 commit e2cc8bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/formtastic-bootstrap/inputs/base/hints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lib/formtastic-bootstrap/inputs/base/wrapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,24 @@ 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
end

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
Expand Down

0 comments on commit e2cc8bc

Please sign in to comment.