Module: ActiveAdmin::ViewHelpers::RendererHelper
- Included in:
- Renderer, ActiveAdmin::ViewHelpers
- Defined in:
- lib/active_admin/view_helpers/renderer_helper.rb
Instance Method Summary collapse
-
#render(*args) ⇒ Object
Adds the ability to render ActiveAdmin::Renderers using the standard render method.
Instance Method Details
#render(*args) ⇒ Object
Adds the ability to render ActiveAdmin::Renderers using the standard render method.
Example:
render MyRendererClass, "Arg1", "Arg2"
which is the same as doing
MyRendererClass.new(self).to_html("Arg1", "Arg2")
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_admin/view_helpers/renderer_helper.rb', line 15 def render(*args) if args[0].is_a?(Class) && args[0].ancestors.include?(ActiveAdmin::Renderer) renderer = args.shift renderer.new(self).to_html(*args) elsif args[0].is_a?(Class) && args[0].ancestors.include?(Arbre::HTML::Tag) tag_class = args.shift insert_tag tag_class, *args else super end end |