Method: Skyline::ButtonHelper#menu_button

Defined in:
app/helpers/skyline/button_helper.rb


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/skyline/button_helper.rb', line 3

def menu_button(title, options={}, &block)
  options.reverse_merge! :id => Guid.new
  
  contents = capture(&block)
  
  txt = <<-EOS
  <dl class="menubutton" id="#{options[:id]}">
    <dt>
      <span class="label">#{title}</span>
      <a class="toggle" href="#"><span><span>down</span></span></a>
    </dt>
    <dd>
      #{contents}
    </dd>
  </dl>
  <script type="text/javascript" charset="utf-8">
    new Skyline.MenuButton('#{options[:id]}')
  </script>
  EOS
  
  txt.html_safe
end