unepwcmc/SAPI

View on GitHub
app/views/admin/simple_crud/_simple_search.html.erb

Summary

Maintainability
Test Coverage
<%= form_tag collection_url,
  :method => :get, :html => {:class => 'form-inline'} do  %>

  <% if params[:type].present? %>
    <%= hidden_field_tag :type, params[:type] %>
  <% end %>

  <div class="input-prepend">
    <span class="add-on"><i class="icon-search"></i></span>
    <%= text_field_tag :query, params[:query], :class => "input-xxlarge" %>
  </div>
  <% if @years %>
    <%= select_tag :year, options_for_select(@years, params[:year]) %>
  <% end %>
  <%= submit_tag 'Search', :class => "btn search-btn"%>
<% end %>