Sha256: a1bd77210eb3b5f55e8c315e795e18f7961eca1dc53d7ec20fb582f82b5db417

Contents?: true

Size: 840 Bytes

Versions: 10

Compression:

Stored size: 840 Bytes

Contents

<%= list.define :item do |options| %>
  <%= options[:field] ? options[:record].send(options[:field]) : options[:record].to_s %>
<% end %>

<%= list.define :items do |options| %>
  <% if records %>
    <% records.each do |record| %>
      <%= content_tag :li, options[:item_html] do %>
        <%= list.use :item, :record => record %>
      <% end %>
    <% end %>
  <% else %>
    <% list.items.each do |item| %>
      <%= content_tag :li, options.merge(item.options)[:item_html] do %>
        <%= list.use item.name %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

<% list.items.each do |item| %>
  <%= list.define item.name, :item => item do |options| %>
    <%= item.name %>
  <% end %>
<% end %>

<%= list.use :list do |options| %>
  <%= content_tag :ul, options[:list_html] do %>
    <%= list.use :items %>
  <% end %>
<% end %>

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
list-for-0.0.1 app/views/list_for/_list_for.html.erb
blocks-1.2.5 app/views/blocks/_list.html.erb
blocks-1.2.4 app/views/blocks/_list.html.erb
blocks-1.2.3 app/views/blocks/_list.html.erb
blocks-1.2.2 app/views/blocks/_list.html.erb
blocks-1.2.1 app/views/blocks/_list.html.erb
blocks-1.2.0 app/views/blocks/_list.html.erb
blocks-1.1.5 app/views/blocks/_list.html.erb
blocks-1.1.4 app/views/blocks/_list.html.erb
blocks-1.1.3 app/views/blocks/_list.html.erb