Sha256: cd454c13d573f9b08d41171a6bd06e4d6e758e38a18f9d3dc0a65b1a280cfc3c

Contents?: true

Size: 1.7 KB

Versions: 2

Compression:

Stored size: 1.7 KB

Contents

<%%# Displays a detailed view of the <%= instance_name %> %>
<%%# Display Flash Message if any only in case of ajax request %>
<%% if request.xhr? %>
	<%%= render :partial=>"layouts/common/flash_message" %>
<%% end %>

<div class="box padding-10">
	
	<div class="margin-10 text-color-blue font-size-24">
		<%%= @<%= instance_name %>.<%= main_string_field %> %>
	</div>
	
	<%- string_fields.each do |name| -%>
		<% next if name == main_string_field %>
	<div class="margin-left-10">
		<%= name.titleize %>: <%%= link_to @<%= instance_name %>.<%= name %>, "#", :class=>"text-color-red" %>
	</div>
	<%- end -%>
	<% puts fields %>
	<%- fields.map{|name, type| name unless ["text", "string"].include?(type)}.compact.uniq.each do |name| -%>
	<div class="margin-left-10">
		<%= name.titleize %>: <%%= @<%= instance_name %>.<%= name %> %>
	</div>
	<%- end -%>
	
	<%- text_fields.each do |name| -%>
	<div class='italic margin-10'><%%= simple_format @<%= instance_name %>.<%= name %> %></div>
	<%- end -%>
	
  <div class="palette-footer margin-left-10">
    <%%= display_time(@<%= instance_name %>.created_at, "pull-left text-color-grey font-size-12") %>
    
    <%%= content_tag :div, :class=>"pretty small danger btn icon-left icon-trash margin-left-10 pull-right" do %>
      <%%= link_to "Delete", <%= resource_link('destroy', 'path') %>(@<%= instance_name %>), method: :delete, data: { confirm: 'Are you sure?' }, :remote=>true %>
    <%% end %>
    
    <%%= content_tag :div, :class=>"pretty small medium primary btn icon-left icon-pencil margin-left-10 pull-right" do %>
      <%%= link_to "Edit", <%= resource_link('edit', 'path') %>(@<%= instance_name %>), :remote=>true %>
    <%% end %>
    
    <div class="cl-10"></div>
  </div>

</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
humdrum-rails-0.0.7 lib/rails/generators/humdrum/resource/templates/views/gumby/resource/_show.html.erb
humdrum-rails-0.0.6 lib/rails/generators/humdrum/resource/templates/views/gumby/resource/_show.html.erb