Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout issue related to ::ApplicationController inheritance #22

Open
mikefowler opened this issue Mar 8, 2013 · 3 comments
Open

Layout issue related to ::ApplicationController inheritance #22

mikefowler opened this issue Mar 8, 2013 · 3 comments

Comments

@mikefowler
Copy link

I don't think this qualifies as an issue, but leaving it here in case you want to mention it somewhere @dewski.

Our team was having an issue where the kss layout file would occasionally fail to load, and we would only see a rendered view with no layout. Inspection of our logs found that because Kss::ApplicationController inherits from ::ApplicationController, there was some code running in our application's before_filter methods that was causing the layout to fail to load. We've solved this by having Kss::ApplicationController inherit from ActionController::Base rather than ::ApplicationController.

@dewski
Copy link
Owner

dewski commented Oct 14, 2013

I've seen a few people get bit by this and it's unfortunate. I liked that it inherited from ApplicationController that way any helpers or authentication filters were preserved. This sounds like a bug in Rails itself, do you remember which Rails version you were on by chance?

@mikefowler
Copy link
Author

I don't, unfortunately. I think it's very likely that our app is just fairly (potentially over-)complicated, not necessarily that this is a bug in Rails.

@nfedyashev
Copy link

In my project I got it solved with this diff:

   layout :layout

   def layout
+    if request.url.include?('/kss')
+      return 'kss/application'
+    end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants