25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/showcase/traits/record.rb', line 25
def box(*args, &block)
options = args.
tag = args.pop || :div
config_block = self.__decorator_class__.__box_config_block__
config_options = if config_block
Helpers::ConfigObject.new(self, &config_block).to_struct.html_options
else
{}
end
html_options = Helpers::HtmlOptions.new(config_options)
html_options.merge_attrs!(options)
html_options.add_class!(dom_class)
html_options.merge_attrs!(id: dom_id)
h.content_tag(tag, html_options.to_h) do
h.capture(self, &block)
end
end
|