Ruby on Rails Tuesday, August 21, 2018

On Mon, Aug 20, 2018 at 7:46 PM, joe@via.net <joe@via.net> wrote:
> 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?

?? 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.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yDEj2rDGSLkTB-X09iHrK0Ad%2BucLEQnRqwjqs3ZW%3DQK0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment