Sha256: ae9cdebbb58c2610a21056a6bb790664870d196b40a14e4a8974e68a65eedd1e

Contents?: true

Size: 1.38 KB

Versions: 59

Compression:

Stored size: 1.38 KB

Contents

<p id="notice"><%= notice %></p>

<h1>Listing Auth Shopping Discounts</h1>

<table>
  <thead>
    <tr>
      <!-- id number, this will also hold links to edit and destroy. -->
      <th>Number</th>
      <th>Id Number</th>
      <!-- get the names of the other fields to be shown-->
      <% @auth_shopping_discounts.first.attributes_to_show.each do |attr| %>
        <%= puts "doing: #{attr}" %>
        <th><%= attr %></th>
      <% end %>
    </tr>
  </thead>
  <tbody>
      <% @auth_shopping_discounts.each_with_index {|auth_shopping_discount,key| %>
      <tr>
        <td><%= key + 1 %></td>
        <td>
          <div>
            <%= link_to auth_shopping_discount.id.to_s, discount_path(auth_shopping_discount) %>
          </div>
          <div>
            <!-- add destory and edit options here -->
            <!-- end -->
            <span><%= link_to 'Edit', edit_discount_path(auth_shopping_discount) %></span>
            <span><%= link_to 'Destroy', discount_path(auth_shopping_discount), method: :delete, data: { confirm: 'Are you sure?' } %></span>
            <!-- here how to show a button, and how to change the form id's so that it uses the object id, -->
          </div>
        </td>
        <% @auth_shopping_discounts.first.attributes_to_show.each do |attr| %>
          <td><%= auth_shopping_discount.send("#{attr}") %></td>
        <% end %>
      </tr>
    <% } %>
  </tbody>
</table>

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.9 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.8 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.7 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.6 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.5 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.4 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.3 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.2 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.1 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.5.0 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.9 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.8 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.7 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.6 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.5 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.4 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.3 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.2 app/views/auth/shopping/discounts/index.html.erb
wordjelly-auth-1.4.0 app/views/auth/shopping/discounts/index.html.erb