Using a partial template to render search results. Show packages by default even without a query.
14 lines
341 B
Text
14 lines
341 B
Text
<h1>Hello, Rails!</h1>
|
|
|
|
<h1>Search for a package/description:</h1>
|
|
|
|
<%= form_tag(url_for, method: "get") do %>
|
|
<%= text_field_tag :search, '', autofocus: true, placeholder: 'Search criteria...' %>
|
|
<%= submit_tag "Search" %>
|
|
<% end %>
|
|
|
|
<h1>Search results</h1>
|
|
|
|
<%= @packages %>
|
|
|
|
<%= render "packages_search_results", object: @packages %>
|