module Trailblazer::Rails::Controller::Cell

Public Instance Methods

render(cell = nil, options = {}, *, &block) click to toggle source
Calls superclass method
# File lib/trailblazer/rails/cell.rb, line 5
def render(cell = nil, options = {}, *, &block)
  return super unless cell.kind_of?(::Cell::ViewModel) # rubocop:disable Style/ClassCheck

  render_cell(cell, options)
end
render_cell(cell, options) click to toggle source
# File lib/trailblazer/rails/cell.rb, line 11
def render_cell(cell, options)
  options = options.reverse_merge(layout: true)

  # render the cell.
  content = cell.()

  render({html: content}.merge(options))
end