简体   繁体   中英

Custom URL routes helper

It seems there is no URL helper generated automatically when you apply custom.

So below is what is defined in my routes.rb file but when I do rake routes I don't have any URL helper generated at all.

get "events/display_event/:id", :to => "events#display_event"

It seems it is generated only for resources in the routes.

Is there a way to generate this automatically or do I have to manually specify without using the helper?

If it has to be done manually in the view, what is the best approach for this?

这应该做到这一点。

get "events/display_event/:id" => "events#display_event", as: :display_event

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