Module: Neuron::ShowFor::Helper
- Defined in:
- lib/neuron/show_for/helper.rb
Instance Method Summary collapse
-
#show_for(object, html_options = {}, &block) ⇒ Object
Creates a div around the object and yields a builder.
Instance Method Details
#show_for(object, html_options = {}, &block) ⇒ Object
Creates a div around the object and yields a builder.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/neuron/show_for/helper.rb', line 14 def show_for(object, ={}, &block) tag = .delete(:show_for_tag) || ::ShowFor.show_for_tag [:id] ||= dom_id(object, :show_for) [:class] = "show_for #{dom_class(object)} #{[:class]}".strip builder = .delete(:builder) || ::ShowFor::Builder content = capture(builder.new(object, self), &block) content_tag(tag, content, ) end |