Module: Strolljs::Helper

Defined in:
lib/strolljs-rails/helper.rb

Instance Method Summary collapse

Instance Method Details

#stroll(div_id, ul_class, items = []) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/strolljs-rails/helper.rb', line 4

def stroll(div_id, ul_class,items=[])

  js_tag = javascript_tag ("stroll.bind( '##{div_id} ul' );")

  html_tag = (:div, :id => div_id) do
     :article do
      (:ul, :class => ul_class) do
        items.collect {|item| concat((:li, item))}
      end
    end
  end

  "#{html_tag} #{js_tag}".html_safe

end