Rails is not rendering my application layout Rails is not rendering my application layout ruby-on-rails ruby-on-rails

Rails is not rendering my application layout


I just ran into this same problem myself and the problem is just a simple mistake.

Your controller PublicController is subclassing "ActionController::Base". Controllers other than your ApplicationController need to subclass from ApplicationController in order for their views to be rendered within the application.html.erb layout

If you change

PublicController < ActionController::Base

to

PublicController < ApplicationController

it should work.


Ran into the same problem with one final wrinkle: I was overriding initialize in the subclassed controller. Make sure to call 'super' first thing:

def initialize    super    @some_client = SomeClient.newend