Module: Ramenu::ActionController::HelperMethods

Defined in:
lib/ramenu/action_controller.rb

Instance Method Summary collapse

Instance Method Details

#render_ramenu(options = {}, &block) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ramenu/action_controller.rb', line 45

def render_ramenu(options = {}, &block)
  # passing all flags to Builder (static + volatile)
  options[:flags] = flags(options[:menu])
  builder = (options.delete(:builder) || Menus::SimpleBuilder).new(self, menus(options[:menu]), options)
  content = builder.render.html_safe
  if block_given?
    capture(content, &block)
  else
    content
  end
end