0

I have a search bar in my navigation bar, located in application layout. I'd like it to route to my Offer model's index from anywhere in my site and search those records. Though when I submit, it searches within the view that I'm already in. Does the code below have an error which might be causing this?

<form class="navbar-form navbar-right">
    <%= form_tag(offers_path, :method => :get) do %>
        <%= text_field_tag :search, nil,
                           {:id => "search-query-2", :placeholder => "Search offers..."} %>
        <%= hidden_field_tag :use_keywords, "true" %>
    <% end %>
  </form>
domi91c
  • 1,660
  • 2
  • 20
  • 34

0 Answers0