I am trying to use RJS as shown in this tutorial :
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
However it does not seem to work. I am not getting any excpetions in
the logs. Here is what the logs say :
Parameters: {“action”=>“add”, “controller”=>“homepage”}
Rendering homepage/add
The homepage/add is named add.rjs
I know that this file is being accessed, if I put some incorrect code
there it complains in the logs.
I am not sure that “rake rails:update” (in the application folder) works
correctly for me. This is because I have updated to the latest version
of rails and then I copied conf/boot.rb to /tmp folder and did this
command
rake rails:update:configs
According to this post
http://weblog.rubyonrails.org/articles/2006/04/09/rails-1-1-2-tiny-fix-for-gems-dependenciesI
It should update your boot.rb. But I did a diff and the files are the
same. This could mean that I have not got the correct js files to allow
RJS to work? Is there a way of checking if I have the correect JS files
that support RJS ?
Here is ths code :
homepage/add.rjs :
page.replace_html ‘header’,‘RJS Template Test Complete!’
in homepage/list
RJS Template Test
<%= link_to_remote("Change Title", :url =>{ :action => 'add' }) %>in the homepage controller
def add
end
By the way I am importing the javascripts like this :
<%= javascript_include_tag :defaults %>
I would appreciate any help, as I have been struggling all morning.
Thanks in advance.
Hamza