Apologies in advance if this is a silly question, am very much a beginner.
The rails book I’m reading has reached the point where the reality of the current rails framework differs from the one that was current in the book. Specifically, this is around Ajax functionality. The book suggests creating an app/views/comments/new.js.erb file to handle ajax requests, as also demonstrated by this railscast;
http://railscasts.com/episodes/205-unobtrusive-javascript?autoplay=true
Is this still the way things are done in rails 3.1? I have seen that the javascripts/stylesheets are now fed through the assets pipeline, I was wondering if this has changed the way that ajax requests are performed (even if it’s just a new suggestion of best practice). Can I still rely on tutorials that suggest creating js.erb files in the views folder or is there a new best practice?
Here you have a railscast about the Asset Pipeline: http://railscasts.com/episodes/279-understanding-the-asset-pipeline.
The Asset Pipeline serves static assets, not dynamic, so we should still rely in js.erb files.
You may also want to check this Guide, which mentions how to use js.erb files in conjunction with the Asset Pipeline: http://guides.rubyonrails.org/asset_pipeline.html#javascript-coffeescript-and-erb