Hi, I am quite new to rails and can’t use any rjs-templates.
The problem is, that he can’t use/find the methods in that template
e.g. ‘page’ or ‘replace_html’. I get an error message on these
methods.
Here’s what I got so far in my example:
Controller:
class AjaxTestController < ApplicationController
layout ‘application’, :except => :say_hello
def index
end
def say_hello
@message = “Hello World”
respond_to do |format|
format.js
end
end
end
Layout
<?xml version="1.0" encoding="UTF-8"?> Ajax <%= javascript_include_tag :defaults %> <%= yield %> ----index.html.erb
Helloworld#index
<%= link_to_remote “Click”,
:url => {:action => “say_hello”} %>
…
say_hello.rjs
page.replace_html ‘message’, @message
page.visual_effect(:highlight, ‘message’, :duration => 0.5)
its quite simple but does not work anyway. I don’t guess why it
behaves like this. If I use the controller for that ajax request,
everything is ok…it’s just that template thing i can’t fix. Anyone
got an idea where the problem might be?