简体   繁体   中英

Rails routes and helper functions

I have defined the following route on my routes file:

match "/users/:id/courses", :to => 'users#courses'

Do you know what is the helper function that is generated for that route?

I have tried this:

users_courses_path(current_user)
user_courses_path(current_user)
users_course_path(current_user)
user_course_path(current_user)

But none of those works

Regards

更好的是,您可以创建自己的帮助器,例如:

match "/users/:id/courses", :to => 'users#courses', :as => :users_courses # or anything you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM