Sha256: 85461668bb254077f84d8f624a26776790b34fc6f55127811facc6ca79a1cac1

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 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.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

1 entries across 1 versions & 1 rubygems

Version Path
mdd-3.0.13 lib/generators/mdwa/templates/templates/scaffold/views/show.html.erb