Topic: Simple highlight question

I'm trying to do a simple highlight visual effect, as I try to learn AJAX.  I just want to click a link titled 'highlight' and see if I'm doing things properly to highlight the selected tag.  When the 'highlight' link is clicked, I want to highlight the 'grand_total' div tag value.  Below is the code I have:

# in list.rhtml
<%= link_to_remote 'highlight', :url => { :action =>'create' } %>

<div id="grand_total">
  <u>Grand Total</u>: <%= number_to_currency($grand_total) %>
</div> 

I created a 'create.rjs' file in the views folder.  In that file I have:

# in create.rjs
page[:grand_total].visual_effect :highlight

If you have any suggestions or notice any problems, please let me know.  Also, my computer defaults '.rjs' files to a RealSystem Skin type, which is a media player.  Is this a problem?  Thanks for any help.

Re: Simple highlight question

daniel_l wrote:

If you have any suggestions or notice any problems, please let me know.

It looks correct to me. If it's not working, see this episode on debugging rjs.

daniel_l wrote:

Also, my computer defaults '.rjs' files to a RealSystem Skin type, which is a media player.  Is this a problem?  Thanks for any help.

It shouldn't cause a problem.

Railscasts - Free Ruby on Rails Screencasts