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

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

Comments

Projects
None yet
2 participants
Contributor

masterkain commented Jun 13, 2011

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.

Contributor

raviolicode commented Jun 18, 2011

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

Contributor

masterkain commented Jun 19, 2011

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

Contributor

masterkain commented Jun 19, 2011

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.

masterkain closed this Jun 19, 2011

@jake3030 jake3030 pushed a commit to jake3030/rails that referenced this issue Jun 28, 2011

@stepheneb @NZKoz stepheneb + NZKoz Adding AR tests for JDBC connections
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>
[#1685 state:committed]
4ef9845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment