6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/frails/component/component_renderer.rb', line 6
def render(context, options, &block)
@view = context
@component = options.delete(:component).to_s
@presenter = presenter_class.new(@view, options)
result = @presenter.run_callbacks :render do
if @presenter.respond_to?(:render)
@presenter.render(&block)
else
options[:locals] = @presenter.locals
super context, options, block
end
end
apply_styles((result.respond_to?(:body) ? result.body : result) || nil)
end
|