Query parameters with url_for?

后端 未结 4 1250
耶瑟儿~
耶瑟儿~ 2021-01-03 17:45
url_for([:edit, @post])

is working and generating /comments/123/edit. Now I need to add a query parameter, so that instead of

4条回答
  •  抹茶落季
    2021-01-03 18:33

    You can pass params to url_for. Checkout it in the sourcecode: https://github.com/rails/rails/blob/d891c19066bba3a614a27a92d55968174738e755/actionpack/lib/action_dispatch/routing/route_set.rb#L675

提交回复
热议问题