Forum: Ruby on Rails Odd nuance on getting erb or js files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
44a43e7fef8e933e802a7802b4bd3525?d=identicon&s=25 John Small (johnsmall)
on 2008-11-20 18:34
I've got a partial rendered in a something.js.rjs file. This works just
fine when I call the method on the controller using xhr(etc etc) in my
functional tests. So from the point of view of the tests an Ajax request
is pulling the right stuff though and the associated assert_selects are
finding it in the returned result. But...

When I try to get the page fragment via a button in a remote form then
the result is 'could not find template something.html.erb'.

My understanding of this is that the ActionController would look for
something.js.rjs if it couldn't find the html.erb. In this case it
isn't. The request coming through the remote form seems to look like a
standard post request and it's trying to find an html.erb to render the
result. Wtf is going on here?

Comments please

John Small
This topic is locked and can not be replied to.