On 9 May 2011 14:30, Sergio R. [email protected] wrote:
for some reason, it is not working for me…
is there something i need to do to trigger this behavior?
There is no such behaviour in Rails; I think you might have
misunderstood the screencast.
Assuming you are talking about this:
then the ‘index.js.erb’ is rendered when your browser makes an AJAX
request to the ‘index’ action (in the same way that ‘index.html.erb’
is rendered when your browser makes an ordinary request to the index
These are two completely separate requests. index.js.erb is not
being inserted into a script tag in index.html.erb.
If you want that kind of thing to happen, you’ll need to write a
custom view helper (and probably choose a more appropriate path for
conflict with the standard behaviour described above).