我很难理解 Rails 中的路线。我有一个包含一堆投资组合页面的文件夹。每一个都是 .html.erb 格式,我为每一个都做了一条获取路线。
我怎样才能简化这个?
Location: app>views
portfolio/uniquename1.html.erb
portfolio/rexpage.html.erb
portfolio/armstrong.html.erb
portfolio/occupy.html.erb
portfolio/fancythat.html.erb
ETC...
路线如下所示:
NewPortfolio::Application.routes.draw do
get "portfolio/uniquename1"
get "portfolio/rexpage"
get "portfolio/armstrong"
get "portfolio/occupy"
get "portfolio/fancythat"
etc...
谢谢!