Sha256: f05536da6ac9672ae698c43ce280756ad0abc51b4f34276c9aaeda0670355642

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

<%- attributes.each do |attribute| -%>
  <td <%%= visible_column("<%= singular_table_name %>", "<%= attribute.name %>") %> class="col-<%= attribute.name %> <%%= align_attribute("<%= attribute.type %>") %>">
    <%- if @beautiful_attributes.include?(attribute.name + ':price') then -%>
      <%%= number_to_currency(<%= singular_table_name %>.<%= attribute.name %>) %>
    <%- elsif @beautiful_attributes.include?(attribute.name + ':richtext') then -%>
      <%%= truncate(<%= singular_table_name %>.<%= attribute.name + "_fulltext" %>, :length => 30) %>
    <%- elsif @beautiful_attributes.include?(attribute.name + ':boolean') then -%>
      <%%= t((<%= singular_table_name %>.<%= attribute.name %> ? "yes" : "no").to_sym) %>
    <%- elsif @beautiful_attributes.include?(attribute.name + ':references') then -%>
      <%% if not <%= singular_table_name %>.<%= attribute.name %>_id.nil? then %>
        <%%= link_to <%= singular_table_name %>.<%= attribute.name %>.caption, <%= namespace_for_route %><%= attribute.name %>_path(<%= singular_table_name %>.<%= attribute.name %>_id) %>
      <%% else %>
        <%%= t(:any, :default => "Any") %>
      <%% end %>
    <%- else -%>
      <%%= <%= singular_table_name %>.<%= attribute.name %> %>
    <%- end -%>
  </td>
<%- end -%>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
beautiful_scaffold-0.2.6 lib/generators/templates/app/views/partials/_index_column.html.erb
beautiful_scaffold-0.2.5 lib/generators/templates/app/views/partials/_index_column.html.erb
beautiful_scaffold-0.2.4 lib/generators/templates/app/views/partials/_index_column.html.erb
beautiful_scaffold-0.2.3 lib/generators/templates/app/views/partials/_index_column.html.erb