I have paginate (kaminari) on search page, and if i search somthing with % like "50% discount" i get page http://some.domain.com/50%25+discount
where paginate has wrong urls (without escaping %) like:
http://some.domain.com/50%+discount?page=2
Do i do somthing wrong? Or it's bug in gem?
Thank you
My solutions is
paginate @entities, :params => { :keyword => CGI.escape(@keyword) }
in
route.rb
i havematch "/:keyword" => "route#index", :keyword => /.*/
% is a special character in urls isn't it? Your going to need your search method to sanitize the query before it gets passed to the url.
I believe you can use the methods for the String class provided in the gem Stringex to sanitize the search term.
https://github.com/rsl/stringex
From there github page.
Edit:
You would need to have something like this (This isn't very clean but it gives you an idea)
routes
You would be acting like your treating it like a normal object but your never actually saving it. You could even change the name of the :create method to parse if you want, but this way the built in rails helpers and logic will work.