Sha256: 46ac00ee0b16291def6f73b796b123010740af606a917b64bea0b8821a00762c
Contents?: true
Size: 1.63 KB
Versions: 7
Compression:
Stored size: 1.63 KB
Contents
===entity_code=== <div id="<%= @model.plural_name %>_show" class="mdwa_show"> <div class="page_header"> <h1><%%= t('<%= @model.plural_name %>.show_title') %></h1> </div> <div class="inside"> <%- @model.attributes.select{|a| a.name != 'id' and a.name != 'created_at' and a.name != 'updated_at'}.each do |attr| -%> <div class="field"> <label><%%= t '<%= @model.plural_name %>.show_<%= attr.name %>' %></label> <%- if attr.type.to_sym == :file -%> <%% unless @<%= @model.singular_name %>.<%= attr.name %>.nil? %> <span><%%= link_to image_tag(file_icon_path(@<%= @model.singular_name %>.<%= attr.name %>_file_name)), @<%= @model.singular_name %>.<%= attr.name %>.url, :target => '_blank' %></span> <%% else %> No file. <%% end %> <%- else -%> <span><%%= @<%= @model.singular_name %>.<%= attr.name %> %></span> <%- end -%> </div> <%- end -%> <%- @model.associations.each do |assoc| -%> <div class="field"> <label><%%= t '<%= @model.plural_name %>.show_<%= assoc.model2.singular_name %>' %></label> <span> <%- if assoc.belongs_to? || assoc.nested_one? -%> <%%= @<%= @model.singular_name %>.<%= assoc.model2.singular_name %>.<%= assoc.reference_field %> unless @<%= @model.singular_name %>.<%= assoc.model2.singular_name %>.nil? %> <%- elsif assoc.has_many? or assoc.nested_many? -%> <ul> <%% @<%= @model.singular_name %>.<%= assoc.model2.plural_name %>.each do |<%= assoc.model2.singular_name %>| %> <li><%%= <%= assoc.model2.singular_name %>.<%= assoc.reference_field %> %> </li> <%% end %> </ul> <%- end -%> </span> </div> <%- end -%> </div> </div>
Version data entries
7 entries across 7 versions & 1 rubygems