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

[3.1-stable] layout directive not working with controller inheritance #1685

Closed
masterkain opened this issue Jun 13, 2011 · 3 comments
Closed

Comments

@masterkain
Copy link
Contributor

class ApplicationController < ActionController::Base
  protect_from_forgery
  layout Proc.new { |controller| controller.request.xhr? ? 'ajax' : 'application' }
end

class StoresController < ApplicationController
  def search
  end
end

When the search action is called through Ajax (passing the proper X-Requested-With:XMLHttpRequest header) only the 'application' layout will be rendered along with the view.

On the other side if we copy/move the layout declaration in StoresController it works.

@raviolicode
Copy link
Contributor

These tests pass on 3-1-stable, can you give more information?

@masterkain
Copy link
Contributor Author

I tried with a quick rspec 2 test: https://gist.github.com/1033747

@masterkain
Copy link
Contributor Author

I narrowed down the problem, it has something to do with the pjax_rails gem, closing.
https://github.com/masterkain/pjax_rails/blob/master/lib/pjax.rb#L5

Thanks @raviolicode for chiming in.

jake3030 pushed a commit to jake3030/rails that referenced this issue Jun 28, 2011
New connections:

  jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb jdbcpostgresql

To test you will need the native database installed (if one is required),
activerecord-jdbc-adapter and the specific activerecord-jdbc<database>-adapter
for the database you are testing.

Run the tests like this:

  jruby -S rake test_jdbcmysql

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[rails#1685 state:committed]
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

2 participants