# RJS problem

**URL:** <https://www.ruby-forum.com/t/rjs-problem/229130>\
**Category:** Rails\
**Created:** [January 29, 2007, 4:08am UTC](https://www.ruby-forum.com/t/rjs-problem/229130 "2007-01-29T04:08:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 4:08am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/1 "2007-01-29T04:08:24Z")

</div>

Hi,

I’m implementing a “digg-like” page, that once you digg. The score for  
each item will dynamically reflect your current action +1 .

## I am not sure what’s In the controller I have an action responsible for increase of the score.It has a corresponding rjs in view.

def arouse  
@p=Product.find(params[:id])  
@list=List.find\_favolist(session[:user\_id])  
@li=LineItem.findaddeditem(@p.id,@list.id)  
fair=@li.nil?  
puts fair

if fair  
puts ‘success’  
@p.popular\_score +=1  
@p.save  
puts “add”  
@li = LineItem.new  
@li.product\_id =params[:id]  
@li.list\_id =@list.id  
@li.likeornot =1  
@li.created\_at = Time.now  
puts “line”  
@li.save  
redirect\_to\_index(“æŽ¨æ–‡æˆåŠŸ”) --\> never worked, why?

else  
redirect\_to\_index(“ä¸€äººåªæœ‰ä¸€ç¥¨å”·”) --\> never worked, why?

end

## end

In the view, I have a div displaying the score.

```
            <% if product ==@p %>
<div id="current_product">
<%= render(:partial => "score", :object => @p) %>
<% else %>
<div class="score">

<%= product.popular_score %>
<% end %> </div>

```

* * *

In arouse.rjs

## page[:current\_product].replace\_html :partial =\> ‘score’, :object =\> @p

In \_score.rhtml

## \<%= @p.popular\_score %\>

These are pretty much the setting.  
But it just does not update the new score as I call the arouse with  
form\_remote\_tag.  
Is there anything I’m missing here?

Any suggestion and ideas are high welcomed.

Abon

---

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 7:42am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/2 "2007-01-29T07:42:51Z")

</div>

On 1/28/07, Bontina C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > –  
> > > being passed back to the page from your RJS. The following post will  
> > > This is what I got.  
> > > C:/INSTAN~1/rails\_apps/test/config/…/app/views/admin/arouse.rjs:1:  
> > > href=“#”
> 
> ```
> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:307:in
> `render_without_benchmark'
> C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
> `process_client'
> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in
> `run'
> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in
> `render' C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
> `perform_action_without_rescue'
> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
> `run'
> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in
> `run'
>   attributes:     name: !binary |      
> 
> Thanks
> 
> --
> Posted via http://www.ruby-forum.com/.
> 
> >
> 
> ```

`
You might try the older syntax of:
page.replace_html ‘current_product’, :partial => ‘score’, :object => @p
There are other issues too. You are assigningg @p to the implicit
local variable score in the partial which you never use. So assigning
:object => @p is not needed according to the code in your partial.
This wouldn’t cause the problem your seeing though.
–
Zack C.
http://depixelate.com`

---

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 4:39am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/3 "2007-01-29T04:39:40Z")

</div>

On 1/28/07, Bontina C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> def arouse  
> puts “add”  
> redirect\_to\_index(“Ò»ÈËÖ»ÓÐÒ»Æ±à¡”) → never worked, why?  
> \<% else %\>
> 
> Abon
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

Bontina,

Try page[“current\_product”].replace\_html …

I don’t think the symbol form will work. Also check the javascript  
being passed back to the page from your RJS. The following post will  
show you how:  
[http://www.railsweenie.com/forums/2/topics/785](http://www.railsweenie.com/forums/2/topics/785)

Hope this helps.

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 6:09am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/4 "2007-01-29T06:09:32Z")

</div>

Zack C. wrote:

> On 1/28/07, Bontina C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > def arouse  
> > puts “add”  
> > redirect\_to\_index(“Ò»ï¿½ï¿½Ö»ï¿½ï¿½Ò»Æ±ï¿½”) → never worked, why?  
> > \<% else %\>
> > 
> > Abon
> > 
> > –  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > >
> 
> Bontina,
> 
> Try page[“current\_product”].replace\_html …
> 
> I don’t think the symbol form will work. Also check the javascript  
> being passed back to the page from your RJS. The following post will  
> show you how:  
> [http://www.railsweenie.com/forums/2/topics/785](http://www.railsweenie.com/forums/2/topics/785)
> 
> Hope this helps.
> 
> –  
> Zack C.  
> [http://depixelate.com](http://depixelate.com)

I tried the syntax you suggested and added the debig tool.  
This is what I got.  
http status: 500

```
Action Controller: Exception caught 
 body { background-color: #fff; color: #333; } body, p, ol, ul, 
td { font-family: verdana, arial, helvetica, sans-serif; font-size: 
13px; line-height: 18px; } pre { background-color: #eee; padding: 10px; 
font-size: 11px; } a { color: #000; } a:visited { color: #666; } a:hover 
{ color: #fff; background-color:#000; }
# 

SyntaxError in Admin#arouse

Showing  
_app/views/admin/arouse.rjs_ where line **#1** raised:

```
compile error 
C:/INSTAN~1/rails_apps/test/config/../app/views/admin/arouse.rjs:1: 
Invalid char `\357' in expression 
C:/INSTAN~1/rails_apps/test/config/../app/views/admin/arouse.rjs:1: 
Invalid char `\273' in expression 
C:/INSTAN~1/rails_apps/test/config/../app/views/admin/arouse.rjs:1: 
Invalid char `\277' in expression
```

Extracted source

(around line **#1** ):

```
1:
ï»¿page["current_product"].replace_html :partial => ‘score’,
:object => @p
```

Trace of template inclusion:  
/app/views/admin/arouse.rjs

`RAILS_ROOT:
C:/INSTAN~1/rails_apps/test/config/…`

 Application Trace | Framework Trace | Full Trace 

```
#{RAILS_ROOT}/app/views/admin/arouse.rjs:3:in 
`compile_template'
```

 
 \<div id="Framework-Trace" 

style=“display: none;”\>

```
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:307:in 
`compile_and_render_template' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in 
`render_template' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:in 
`render_file' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:726:in 
`render_file' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:648:in 
`render_with_no_layout' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:253:in 
`render_without_benchmark' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in 
`render' C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in 
`render' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:942:in 
`perform_action_without_filters' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in 
`perform_action_without_benchmark' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue' 
C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in 
`perform_action' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in 
`send' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in 
`process_without_filters' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in 
`process_without_session_management_support' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in 
`process' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in 
`dispatch' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/rails.rb:73:in 
`process' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:551:in 
`process_client' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in 
`each' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in 
`process_client' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`initialize' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`new' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in 
`initialize' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in 
`new' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:956:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:in 
`each' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:127:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/command.rb:199:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:235 
C:/INSTAN~1/ruby/bin/mongrel_rails:18:in `load' 
C:/INSTAN~1/ruby/bin/mongrel_rails:18
```

 
<div

id=“Full-Trace” style=“display: none;”\>

```
#{RAILS_ROOT}/app/views/admin/arouse.rjs:3:in 
`compile_template' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:307:in 
`compile_and_render_template' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in 
`render_template' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:in 
`render_file' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:726:in 
`render_file' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:648:in 
`render_with_no_layout' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:253:in 
`render_without_benchmark' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in 
`render' C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in 
`render' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:942:in 
`perform_action_without_filters' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in 
`perform_action_without_benchmark' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue' 
C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in 
`perform_action' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in 
`send' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in 
`process_without_filters' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in 
`process_without_session_management_support' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in 
`process' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in 
`dispatch' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/rails.rb:73:in 
`process' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:551:in 
`process_client' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in 
`each' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in 
`process_client' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`initialize' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`new' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in 
`initialize' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in 
`new' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:956:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:in 
`each' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:127:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/command.rb:199:in 
`run' 
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:235 
C:/INSTAN~1/ruby/bin/mongrel_rails:18:in `load' 
C:/INSTAN~1/ruby/bin/mongrel_rails:18
```

<h2

style=“margin-top: 30px”\>Request

**Parameters** :  
{"commit"=\>"\346\216\250",  
"id"=\>"64"}

Show session dump

```
— :user_id: 1🧺
!ruby/object:Basket   items: [] :list: &id001 !ruby/object:List
  attributes:     name: !binary |      
5b6p5Y+k6aKo     id: "15"     user_id:
"1"     created_at: 2007-01-21 10:56:46  
errors: !ruby/object:ActiveRecord::Errors     base: *id001
    errors: {} flash: !map:ActionController::Flash::FlashHash
{}
```

## Response

**Headers** : {"cookie"=>[],
"Cache-Control"=>"no-cache"}
```

Any furthur hint?

Thanks

---

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 8:09am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/5 "2007-01-29T08:09:55Z")

</div>

On 1/28/07, Bontina C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> <p>
> 
> ```
> 
> I got the the right div updated in the html source.  
> But still I did not see any change on the web page.  
> Any idea what’s going wrong?  
> Thanks
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

page[:score#{@p.id}] will not give you what you want.

Try page[“score#{@p.id}”] to get the substitution working right. The  
reason your not seeing anything is because of the error in your RJS  
syntax. That’s why the ajax debugging shows those errors (from your  
last post).

Also, did you try this syntax?

page.replace\_html “score#{@p.id}”, :partial =\> ‘score’, :object =\> @p

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 8:29am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/6 "2007-01-29T08:29:26Z")

</div>

> Try page[“score#{@p.id}”] to get the substitution working right. The  
> reason your not seeing anything is because of the error in your RJS  
> syntax. That’s why the ajax debugging shows those errors (from your  
> last post).
> 
> Also, did you try this syntax?
> 
> page.replace\_html “score#{@p.id}”, :partial =\> ‘score’, :object =\> @p
> 
> –  
> Zack C.  
> [http://depixelate.com](http://depixelate.com)

COOL It works for page[“score#{@p.id}”]  
So the syntax I used is the older version?

---

<div class="post-metadata">

**Author:** ![abon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@abon](https://www.ruby-forum.com/u/abon)\
**Post date:** [January 29, 2007, 7:49am UTC](https://www.ruby-forum.com/t/rjs-problem/229130/7 "2007-01-29T07:49:33Z")

</div>

I change the view to

\<% for product in @products %\>

```
<tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') 

```

%\>"\>

```
  <td>
    <img class="list-image" src="<%= product.image_url1 %>"/>
<p>
<div class="score">
    <div id="score<%= product.id%>">
<%= product.popular_score %>
</div></div></p>
  </td>

```

* * *

## in arouse.rjs page[:score#{@p.id}].replace\_html :partial =\> ‘score’, :object =\> @p

and from the ajax debug tool.  
I got the the right div updated in the html source.  
But still I did not see any change on the web page.  
Any idea what’s going wrong?  
Thanks
