EDIT 2
Related question here.
EDIT
This is the route I need to submit to:
get '/s/:term', controller: :products, action: :search, as: :search_products
I have a search form like this:
<%= form_tag(search_products_path, :method => "get", id: "search-form", name: "f1", enforce_utf8: false) do %>
<div class="input-group">
<%= text_field_tag :search, params[:search], placeholder: "Search products", class: "form-control", name: "search" %>
<div class="input-group-btn">
<button class="btn btn-secondary">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<% end %>
But this creates the url like this:
domain/s?search=[user input]
I need the URL to be like this instead:
domain/s/[user_input]
Yes I do know this is not following Rails convention. I couldn't care less at this point, I just need to figure it out.
Thanks.