I’ve run across a weird problem with RJS that I’m trying to figure out:
I have an application that was running 0.13.1 that I recently upgraded
to Rails 1.0. I wanted to use RJS templates, so I installed the plugin
and updated my prototype javascript file via ‘rake update_prototype.’
I attempted to test the templates out via the following code, but the
AJAX callbacks did not get processed when the action was completed. No
errors occurred (Javascript errors or application errors from the
log). The update simply does not occur.
When I build a new Rails application and install the plugin, the
templates work as advertised. They just don’t work with the existing
app.
class TestController < ApplicationController
The test view is rendered via this action
def index
end
This action updates the view via an RJS template
def test
end
end
views/test/index.rhtml:
<%= javascript_include_tag :defaults %>
views/test/test/rjs:
page.replace_html ‘test’, ‘hello’
I’m struggling to figure out why they work in the new application and
not in the existing one - I would think the parts of a rails app that
could impact RJS would be the version of Rails installed, the version
of the plugin installed, and the version of prototype. However, as
stated earlier, all of these are the same (unless I made a dumb
mistake).
Anyone have any ideas why everything seems to work but the most
important part, the callbacks?
- Derek
–
Derek H.
HighGroove Studios - http://www.highgroove.com
Atlanta, GA
Keeping it Simple.
404.593.4879