How do i view other html pages in ruby on rails

rails

#1

When I click run, it previews the home page; however, i want to view other html files in my ruby on rails app. how do i do this?

when i open another html file, it just shows the home page as well.


#2

If you right click preview to the file it will render the page within the IDE window. If you are trying to open on a running web server you need a defined route for it.


#3

Thanks for answering my question.

i’m able to render in IDE window. I don’t know how to create a defined route for it. the code is shared with different pages because it’s on the side column and i think that’s where i’m confused. I’ll do some research unless you have suggestions on where I can look to find help in defining routes for shared files.


#4

Oh I see it sounds like you are trying to include a partial to be used on multiple pages. For that you don’t need a route, you just need to make sure you have the right path in your code.

Do you have something like this in your other html file?

<%= render 'shared/side_column' %>

And does your other html file have a .erb at the end of the name so you can embed ruby code in it?