Rails: URL/path with parameters

后端 未结 5 753
野性不改
野性不改 2021-02-03 18:47

I would like to produce a URL as

/swimming/students/get_times/2013-01-01/2013-02-02

from this route

get_class_swimming_students         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-03 18:57

    For any path you can pass params like

    get_class_swimming_students_path(:params1 => value1, :params2 => value2)
    

    And In controller you can simply access those passed params as usual

提交回复
热议问题