app/views/rademade_admin/abstract/index.html.erb in rademade_admin-0.0.1 vs app/views/rademade_admin/abstract/index.html.erb in rademade_admin-0.0.2

- old
+ new

@@ -19,16 +19,17 @@ <% end %> <table class="table table-hover"> <thead> <tr> - <% @list_fields.each_with_index do |name, index| %> - <th class="col-md-3 sort-button" data-column="<%= name %>"> + <% @list_fields.each_with_index do |name, index| + list_field_name = field_name(name) + %><th class="col-md-3 sort-button" data-column="<%= list_field_name %>"> <% unless index == 0 %> <span class="line"></span> <% end %> - <span><%= field_to_label(name) + @sortable_service.sorting_sign(name) %></span> + <span><%= field_to_label(name) + @sortable_service.sorting_sign(list_field_name) %></span> </th> <% end %> <th class="col-md-3 align-right"> <span class="line"></span> @@ -37,18 +38,18 @@ </tr> </thead> <% has_position = @sortable_service.has_position? %> <tbody class="table-sortable" data-position='<%= has_position %>'> - <% @items.each_with_index do |item, index| %> + <% @items.each_with_index do |item| %> <tr<% if has_position %> id='<%= item.position %>'<% end %> data-id='<%= item.id %>'> <% @list_fields.each do |name| %><td><% - value = item.send(name) + value = field_value(name, item) # todo remove hard code, extract helper (data adapter) if value.respond_to? :id concat link_to value.to_s, admin_edit_uri(value) else concat value \ No newline at end of file