0

What I'd like to do is to link to static pages in Rails.

The page is created in sample.com/path1/path2/page.html.erb

How can I link to page.html.erb?

SamuraiBlue
  • 851
  • 2
  • 17
  • 44

1 Answers1

1

in your routes.rb you should have something like

get '/page', to: 'path#page', as: :page

where path is the folder where the page file is in

eg

get '/page', to: 'layout#page', as: :page

then you will link with

<li><%= link_to "page", page_path %>