I have setup a nested resource like /projects/1/tasks and want to use sort_link method.
With <%= sort_link @search, :taskname %> i expect /projects/1/tasks?q... but i do get /tasks?q....
Is this possible?
You can pass options to the sort_link helper, for example
sort_link @search, :taskname, { :controller => tasks, action: "index", project_id: @project.id }
where options can be anything that is accepted by the url_for helper
see: https://github.com/ernie/ransack/blob/v0.6.0/lib/ransack/helpers/form_helper.rb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With