I have two views for the same controller/action: home/index.html.haml home/index.js.coffee
I'm using the rails jquery adapter (see Gemfile below).
Then I make a normal ajax call (with data-remote=true) and in development mode rails renders the right view index.js.coffee.
In production mode however index.html.haml is always being called instead of the js one.
Assets are precompiled and I have no JS errors.
Browsers sends that right data and headers.
Rails itself says it's processing JS:
Started GET "/?page=2" for 188.8.131.52 at 2011-10-25 16:26:45 +0000
Processing by HomeController#index as JS
Rendered home/index.html.haml (172.3ms)
Completed 200 OK in 178ms (Views: 177.3ms)
But as you can see the wrong view is being rendered.
gem 'rails', '3.1.1'
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
# Just render, please
I also tried with the classic respond_to/respond_with to no avail. All works in development but not in production.
@masterkain could you check if this issue still persists on latest 3.2.x versions? There have been some changes on rendering and formats since 3.1. Please try checking and reporting back so we can verify if it's still an issue or if this could be closed. Thanks.
My project is on Rails 3.2.3 now and I don't experience particular issues. Thanks.