Hey, I want to name my route using the :as parameter. Ive read the Rails Routing Guide about this but unfortunately it wont display me /my_courses in the url
match 'course_enrollments', :to => 'course_enrollments#index', :as => 'my_courses'
thx for your time!
match 'my_courses', :to => 'course_enrollments#index', :as => 'my_courses'This will route
/my_coursesto the index action of your CourseEnrollments controller, and allow you to refer to the path by referencingmy_courses_pathormy_courses_urlin your views and controllers.To clarify: The first parameter in match is what maps the route to an actual URL. The
:asoption simply allows you to override the name of the route helper.