Module: Blocks::ViewExtensions
- Defined in:
- lib/blocks/action_view_extensions/view_extensions.rb
Instance Method Summary collapse
- #blocks ⇒ Object
- #render_with_overrides(*args, &block) ⇒ Object (also: #with_template)
Instance Method Details
#blocks ⇒ Object
5 6 7 |
# File 'lib/blocks/action_view_extensions/view_extensions.rb', line 5 def blocks @blocks ||= Blocks.builder_class.new(self) end |
#render_with_overrides(*args, &block) ⇒ Object Also known as: with_template
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/blocks/action_view_extensions/view_extensions.rb', line 9 def render_with_overrides(*args, &block) = args..with_indifferent_access partial = .delete(:partial) || .delete(:template) || args.first if builder = .delete(:builder) builder.view = self # builder = builder.clone # TODO: figure out what to do here else # TODO: options shouldn't have to be passed both here and to the render_with_overrides call below - need it to be just one place builder = Blocks.builder_class.new(self, ) end builder.render_with_overrides(.merge(partial: partial), &block) end |