Answer the question
In order to leave comments, you need to log in
ransack. How to convert parameters into a semantic URL?
Hello.
There is one filter (ransack), which leaves minced meat from the parameters after filtering
http://localhost:3000/search?utf8=%E2%9C%93&q%5Barticul_cont%5D=&q%5Bcolor_id_eq%5D=10&q%5Bcatalog_id_eq%5D=&q%5Bbrand_id_eq%5D=&q%5Bcost_gt%5D=&q%5Bcost_lt%5D=&commit=Search
http://localhost:3000/search/Nokia/Finland/plastic/black
http://localhost:3000/search/black
http://localhost:3000/search/Finland
Answer the question
In order to leave comments, you need to log in
One of the ways to solve the problem.
On the server side, generate a url from everything that is in params[:q], pass the url as a parameter to js and substitute it there instead of what is
$(document).ready ->
history.pushState('', 'New Page Title', gon.absolute_url)
# роут для фильтра
get '/search/*filter', to: 'wallpapers#search', as: 'filter'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question