Sha256: 390c5ef51dc1f1db85eefa627f697b4a452d9dd7d92573223fe7bb331749c8b4

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

<% @current_user.applications.each do |app| %>

  <table>

    <thead>
      <tr>
        <th colspan="2"><%= _t(app) %></th>
      </tr>
    </thead>

    <% @current_user.application(app).each do |model| %>

      <%
        klass = model.constantize
        klass_human_name = klass.model_name.human.gsub("/", " ").pluralize
        admin_items_path = { :controller => "admin/#{klass.to_resource}" }
      %>

      <tr class="<%= cycle("even", "odd") %>">
        <td>
          <%= link_to klass_human_name, admin_items_path %>
        </td>
        <td class="right">
          <%= link_to_if @current_user.can?("create", klass), _t("Add"), admin_items_path.merge(:action => "new") %>
        </td>
      </tr>

    <% end %>

  </table>

<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
typus-1.0.0.pre8 app/views/admin/helpers/dashboard/_applications.html.erb
typus-1.0.0.pre7 app/views/admin/helpers/dashboard/_applications.html.erb