简体   繁体   中英

Rails path helper inconsistency

new_photo_path returns /photos/new .

However, the helper awesome_photos_path is created for /photos/awesome defined as:

resources :photos do
  collection do
    get 'awesome'
  end
end

This is annoying. Is there an easy way to ease the pain?

尝试这个:

match "/photo/awesome" => "photos#awesome", :as => :awesome_photo

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