Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to leave the required params in the url?
There is a form
<%= form_tag static_pages_mytasks_path({category_id: params[:category_id]}), :method => 'get' do |f| %>
<%= select_tag(:status, options_for_select([['опубликовано', 1], ['черновик', 2], ['удалено', 3]],{ selected: params[:status]}), prompt: "Изменить статус", class: "form-control", onchange: "this.form.submit();") %>
</div>
<div class="all_post_city_select">
<%= select_tag(:city_id, options_for_select([['Москва', 1], ['Питер', 2], ['Казань', 3]], {selected: params[:city_id]}),prompt: "Выбрать город",class: "form-control", :onchange => "this.form.submit();") %>
<% end %>
<% Category.where(parent_id: 0).each do |category| %>
<li class="list-group-item">
<%= link_to category.name, static_pages_mytasks_path(category_id:category.id, status: params[:status], city_id: params[:city_id]) %>
<% end %>
Answer the question
In order to leave comments, you need to log in
Add input type="hidden" to the form with the category value:
<%= hidden_field_tag :category_id, params[:category_id] %>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question