Listing entries

<%= start_form_tag :action => 'list' %> <%= error_messages_for 'query' %> <% for column in Entry.content_columns %> <% end %> <% for entry in @entries %> <% end %>
<%= pagination_links(@entry_pages) %>
ID<%= column.human_name %>
<%= text_field 'query', 'id', :size => 4 %> <%= text_field 'query', 'name', :size => 10 %> <%= text_field 'query', 'date', :size => 20 %> <%= text_field 'query', 'memo', :size => 20 %> <%= text_field 'query', 'amount', :size => 10 %> <%= q_bool = @query.approved if q_bool.nil? || q_bool.to_s.empty? q_bool = '' elsif q_bool.to_s.upcase == 'TRUE' q_bool = 'TRUE' elsif q_bool.to_s.upcase == 'FALSE' q_bool = 'FALSE' end select_tag 'query[approved]', [ '', 'TRUE', 'FALSE' ]. map{|x| '' + x.to_s.upcase + ''}.join('') %> <%= submit_tag 'Search' %>
<%=h entry.id %> <%=h entry.name %> <%=h entry.date.strftime('%Y/%m/%d-%H:%M:%S') %> <%=h entry.memo %> <%=h entry.amount %> <%= check_box_tag '_dummy', '', entry.approved, :disabled => true %>| <%= link_to 'Show', :action => 'show', :id => entry %> <%= link_to 'Edit', :action => 'edit', :id => entry %> <%= link_to 'Destroy', { :action => 'destroy', :id => entry }, :confirm => 'Are you sure?', :post => true %>
<%= link_to 'Previous page', { :page => @entry_pages.current.previous } if @entry_pages.current.previous %> <%= link_to 'Next page', { :page => @entry_pages.current.next } if @entry_pages.current.next %>
<%= link_to 'New entry', :action => 'new' %>

UserQuery SQL

<%=h @q_sql %>
<%= end_form_tag %>