Get url for current page, but with a different format

后端 未结 3 1965
我寻月下人不归
我寻月下人不归 2021-01-04 02:14

Using rails 2. I want a link to the current page (whatever it is) that keeps all of the params the same but changes the format to \'csv\'. (setting the format can be done b

3条回答
  •  一向
    一向 (楼主)
    2021-01-04 02:23

    You can use:

    link_to "text of link", your_controller_path(format:'csv',params: request.query_parameters)
    

提交回复
热议问题