I am trying to get the following to work - Basically, the button submits to the searches_controller index action and SHOULD pass the params[:search_task] to it. But for some reason its not working.
<div class="btn-group InterestGroup" role="group" aria-label="">
<button class = "btn btn-success InterestStatButton"><%= User.tagged_with(interest, :on => :tags, :any => true).count %></button>
<%= button_to interest, searches_path, :method => :get, :class => "btn btn-default InterestLabelButton" %>
<%= hidden_field_tag :search_task, interest, :id => "search", :class => "form-control" %>
</div>
On the very same page in the header I have this in the header which is an input field doing the same thing, and works fine. What I don't get it if you look at what each is producing in the HTML the hidden field in the first block of code is the same as the input in the form_tag in the second block of code.
<%= form_tag searches_path, html: {class: "navbar-form navbar-left"}, :method => :get do %>
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table; width:350px;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<%= text_field_tag :search_task, nil, class: "form-control", id: "search", placeholder: "Search for members or content", label: false %>
</div>
</div>
<% end %>