Sha256: 3fb22ac29b0fb04472cb332d32731ea9c13f53bab53e29884314ee9d42d3b8c5

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 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 %>
      <% 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

1 entries across 1 versions & 1 rubygems

Version Path
list-for-0.0.2 app/views/list_for/_list_for.html.erb