Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%- model_class = @model_class unless @model_class.nil? -%>
- <div class="page-header">
- <h1><%=t 'common.search_result.title' %></h1>
- </div>
- <% unless model_class.nil?%>
- <div class = "results box">
- <table class="table table-condensed">
- <thead>
- <tr>
- <% model_columns_collection(@model_class,whitelist = true).each do |column|%>
- <th><%= model_class.human_attribute_name(column[1]) %></th>
- <% end %>
- <th><%=t '.actions', :default => t("helpers.actions") %></th>
- </tr>
- </thead>
- <tbody>
- <% if @results.present? %>
- <% @results.each do |result| %>
- <tr>
- <% model_columns_collection(@model_class,whitelist = true).each do |column|%>
- <td><%= result.read_attribute(column[1]) %></td>
- <% end %>
- <td>
- <% if self.respond_to? "auth_#{result.class.to_s.underscore.gsub("/","_")}_path" %>
- <%= link_to t('.show', :default => t("helpers.links.show", :model => model_class.model_name.human)),
- send("auth_#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
- <%= link_to t('.edit', :default => t("helpers.links.edit", :model => model_class.model_name.human)),
- send("edit_auth_#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
- <!--%= link_to t('.destroy', :default => t("helpers.links.destroy", :model => model_class.model_name.human)),
- send("auth_#{result.class.to_s.underscore.gsub("/","_")}_path", result)
- :method => :delete,
- :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
- :class => 'btn btn-mini btn-danger' %-->
- <% else %>
- <%= link_to t('.show', :default => t("helpers.links.show", :model => model_class.model_name.human)),
- send("#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
- <%= link_to t('.edit', :default => t("helpers.links.edit", :model => model_class.model_name.human)),
- send("edit_#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
- <!--%= link_to t('.destroy', :default => t("helpers.links.destroy", :model => model_class.model_name.human)),
- send("#{result.class.to_s.underscore.gsub("/","_")}_path", result)
- :method => :delete,
- :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
- :class => 'btn btn-mini btn-danger' %-->
- <% end %>
- </td>
- </tr>
- <% end %>
- <% end %>
- </tbody>
- </table>
- </div>
- <% end %>
Add Comment
Please, Sign In to add comment