I am having a hard time understanding routes in rails. I have a folder with a bunch of portfolio pages. Each is in .html.erb format and I have made a get route for each one.
How can I simplify this?
Location: app>views
portfolio/uniquename1.html.erb
portfolio/rexpage.html.erb
portfolio/armstrong.html.erb
portfolio/occupy.html.erb
portfolio/fancythat.html.erb
etc…
Routes look as follows:
NewPortfolio::Application.routes.draw do
get "portfolio/uniquename1"
get "portfolio/rexpage"
get "portfolio/armstrong"
get "portfolio/occupy"
get "portfolio/fancythat"
etc...
Thanks!
Static pages are a little awkward in Rails. You should try to minimize them. Here’s a RailsCast which deals with a few different solutions.