layouts/application.html.erb never getting loaded

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

layouts/application.html.erb never getting loaded

joe@via.net
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cb73086c-1518-43be-99dc-b3563f4ce74a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: layouts/application.html.erb never getting loaded

Hassan Schroeder-2
On Mon, Aug 20, 2018 at 7:46 PM, [hidden email] <[hidden email]> 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 ------------------------ [hidden email]
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 [hidden email].
To post to this group, send email to [hidden email].
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.