I want to pass a params from a text_field_tag to my controller but it doesnt get passed via link_to
<div class="row" id="page-search">
<%= hidden_field_tag :page, params[:page], class: 'form-control', value: '1'%>
<%= text_field_tag :page, params[:page], class: 'form-control', id: 'show-page'%>
<%= link_to 'Go', currencies_path, :remote => true, method: :get, class: "btn btn-default", id: "show-button" %>
</div>
controller method
def index
@currencies = Currency.all.page(params[:page]).per(10)
end
It should call this method which it does but it doesnt pass the params[:page]. Any clue as to how to solve this issue?
Thanks
Based on suggestions, i did this but i am still facing the same issue as it doesnt pass the params
<%= form_tag currencies_path, :method => :get do -%>
<%= text_field_tag :page, params[:page], class: 'form-control', id: 'show-page'%>
<%= hidden_field_tag :page, params[:page], class: 'form-control', value: '1'%>
<%= submit_tag 'Go' %>
<% end %>