<% content_for :page_specific_css do %> <%= stylesheet_link_tag "universal_table/universal-table" %> <% end %>
<% @table_fields.each do |f| %> <%= thead(f) %> <% end %> <% @entries.each do |entry| %> <% @columns.each_with_index do |column, index| %> <% ce = entry.column_entries.where(:table_column_id => column.id).first rescue nil %> <% if !ce.nil? %> <% else %> <% end %> <% end %> <% end %>
<% case ce.type %> <% when "text" %> <%= ce.text %> <% when "editor" %> <%= ce.content.html_safe rescue "" %> <% when "image" %>
<% if !ce.image.nil? %> <% end %>
<% when "date" %> <%= format_date(ce.date, column.date_format) %> <% when "period" %> <% if !ce.period_from.nil? %> <%= format_date(ce.period_from, column.date_format) %> ~ <%= format_date(ce.period_to, column.date_format) %> <% end %> <% end %> <% if index == 0 %> <% end %>
 
<%= content_tag :div, paginate(@entries), class: "pagination pagination-centered" %>
Add Entry