/artists: convert search form to simple form.

This commit is contained in:
evazion
2017-04-26 13:12:20 -05:00
parent d1188d8184
commit b61fdc2c6b

View File

@@ -1,28 +1,5 @@
<table class="search">
<tbody>
<%= form_tag(artists_path, :method => :get, :class => "simple_form") do %>
<tr>
<th><label for="search_name">Name</label>
<td>
<div class="input">
<%= text_field "search", "name", :value => params[:search][:name] %>
<span class="hint">You can search on any name or URL</span>
</div>
</td>
</tr>
<tr>
<th><label for="search_order">Order</label>
<td>
<div class="input">
<%= select "search", "order", [["Recently created", "created_at"], ["Last updated", "updated_at"], ["Name", "name"], ["Post count", "post_count"]], :selected => params[:search][:order] %>
</div>
</td>
</tr>
<tr>
<td><%= submit_tag "Search" %></td>
</tr>
<% end %>
</tbody>
</table>
<%= simple_form_for(:search, url: artists_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :name, label: "Name", hint: "Use * for wildcard", input_html: { value: params[:search][:name] } %>
<%= f.input :order, collection: [["Recently created", "created_at"], ["Last updated", "updated_at"], ["Name", "name"], ["Post count", "post_count"]], selected: params[:search][:order] %>
<%= f.submit "Search" %>
<% end %>