layouts/application.html.erb never getting loaded

9 views
Skip to first unread message

j...@via.net

unread,
Aug 20, 2018, 10:46:27 PM8/20/18
to Ruby on Rails: Talk
I have a small website with only static pages. I have s controller for all the static pages.
Application.html never gets loaded. I have replicated the prelude boilerplate in each static page. It works, but it kinda ugly.

Is there a way to create a .html.erb page to hold all the boilerplate stuff (e.g. !HTML, <head>, etc) and have it automatically loaded 
before any of the static pages?

Thanks,

Joe

Hassan Schroeder

unread,
Aug 21, 2018, 11:35:44 AM8/21/18
to rubyonrails-talk
?? It's created by default: /app/views/layouts/application.html.erb

Kind of the whole point of "layouts" is to wrap content with all that
"boilerplate" automatically. It sounds like your app is basically broken.

I would generate a new app, add your controller and one of your
static pages and play around with that to see how it works, and how
your own app differs.

Re-reading <https://guides.rubyonrails.org/layouts_and_rendering.html>
might help, too.

HTH,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote
Reply all
Reply to author
Forward
0 new messages