views:

22

answers:

2

A workaround that I found was to explicitly state in controller

render :action => :some_action, :layout => false

otherwise JavaScript fails to work

Anyone found this problem or maybe something is wrong with my configuration...

+1  A: 

it's a normal behaviour. How he know that you don't want render this layout ?

You can avoid the layout to all of your js format in add in your ApplicationController

Class ApplicationController

  layout :no_in_js_format

  def no_in_js_format
    if request.format == :js
      return nil
    else
      return 'application
    end
  end
end
shingara
Why would you ever want layout be rendered when rendering js.erb? And it appears it did not render layout in 2.X Versions. But your solution is a good hack until they fix that =)
add a bug on Bugtracker to Rails can be a good solution if you think it's not a good feature
shingara