149
150
151
152
153
154
155
156
157
158
159
160
161
|
# File 'app/helpers/sibu/pages_helper.rb', line 149
def grp(elt, opts = {}, &block)
wrapper = opts.delete(:wrapper) || :div
repeat = opts.delete(:repeat)
children = opts.delete(:children)
t_id = elt.is_a?(Hash) ? elt["id"] : elt
@sb_section = (@sb_section || []) + [t_id]
defaults = {"id" => t_id}
opts = defaults.merge(opts)
opts.merge!({data: {id: @sb_section[1..-1].join('|'), type: "group", repeat: repeat, children: children}}) if action_name != 'show'
html_output = content_tag(wrapper, capture(*elts(elt), &block), opts)
@sb_section -= [t_id]
html_output
end
|