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=-IARJQAGddPM@public.gmane.org? 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 =-7ETwYBW1OEA@public.gmane.org @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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/28/07, Bontina Chen <rails-mailing-list@andreas-s.net> wrote:> > 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 > > -- > Posted via 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 Hope this helps. -- Zack Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zack Chandler wrote:> On 1/28/07, Bontina Chen <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> def arouse >> puts "add" >> redirect_to_index("һ��ֻ��һƱ�") --> never worked, why? >> <% else %> >> >> Abon >> >> -- >> Posted via 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 > > Hope this helps. > > -- > Zack Chandler > http://depixelate.comI tried the syntax you suggested and added the debig tool. This is what I got. http status: 500 <pre><html> <head> <title>Action Controller: Exception caught</title> <style> 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; } </style> </head> <body> <h1> SyntaxError in Admin#arouse </h1> <p> Showing <i>app/views/admin/arouse.rjs</i> where line <b>#1</b> raised: <pre><code>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</code></pre> </p> <p>Extracted source (around line <b>#1</b>): <pre><code>1: page["current_product"].replace_html :partial => ''score'', :object => @p</code></pre></p> <p>Trace of template inclusion: /app/views/admin/arouse.rjs</p> <p><code>RAILS_ROOT: C:/INSTAN~1/rails_apps/test/config/..</code></p> <div id="traces"> <a href="#" onclick="document.getElementById(''Framework-Trace'').style.display=''none'';document.getElementById(''Full-Trace'').style.display=''none'';document.getElementById(''Application-Trace'').style.display=''block'';; return false;">Application Trace</a> | <a href="#" onclick="document.getElementById(''Application-Trace'').style.display=''none'';document.getElementById(''Full-Trace'').style.display=''none'';document.getElementById(''Framework-Trace'').style.display=''block'';; return false;">Framework Trace</a> | <a href="#" onclick="document.getElementById(''Application-Trace'').style.display=''none'';document.getElementById(''Framework-Trace'').style.display=''none'';document.getElementById(''Full-Trace'').style.display=''block'';; return false;">Full Trace</a> <div id="Application-Trace" style="display: block;"> <pre><code>#{RAILS_ROOT}/app/views/admin/arouse.rjs:3:in `compile_template''</code></pre> </div> <div id="Framework-Trace" style="display: none;"> <pre><code>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</code></pre> </div> <div id="Full-Trace" style="display: none;"> <pre><code>#{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</code></pre> </div> </div> <h2 style="margin-top: 30px">Request</h2> <p><b>Parameters</b>: {"commit"=>"\346\216\250", "id"=>"64"}</p> <p><a href="#" onclick="document.getElementById(''session_dump'').style.display=''block''; return false;">Show session dump</a></p> <div id="session_dump" style="display:none"><pre class=''debug_dump''>--- :user_id: 1 :basket: !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 {} </pre></div> <h2 style="margin-top: 30px">Response</h2> <b>Headers</b>: {"cookie"=>[], "Cache-Control"=>"no-cache"}<br/> </body> </html></pre> Any furthur hint? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/28/07, Bontina Chen <rails-mailing-list@andreas-s.net> wrote:> > Zack Chandler wrote: > > On 1/28/07, Bontina Chen <rails-mailing-list@andreas-s.net> wrote: > >> def arouse > >> puts "add" > >> redirect_to_index("һ��ֻ��һƱ�") --> never worked, why? > >> <% else %> > >> > >> Abon > >> > >> -- > >> Posted via 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 > > > > Hope this helps. > > > > -- > > Zack Chandler > > http://depixelate.com > > I tried the syntax you suggested and added the debig tool. > This is what I got. > http status: 500 > <pre><html> <head> <title>Action Controller: Exception caught</title> > <style> 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; } </style> </head> <body> <h1> > SyntaxError in Admin#arouse </h1> <p> Showing > <i>app/views/admin/arouse.rjs</i> where line <b>#1</b> raised: > <pre><code>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</code></pre> </p> <p>Extracted source > (around line <b>#1</b>): <pre><code>1: > page["current_product"].replace_html :partial => 'score', > :object => @p</code></pre></p> <p>Trace of template inclusion: > /app/views/admin/arouse.rjs</p> <p><code>RAILS_ROOT: > C:/INSTAN~1/rails_apps/test/config/..</code></p> <div id="traces"> <a > href="#" > onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; > return false;">Application Trace</a> | <a href="#" > onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; > return false;">Framework Trace</a> | <a href="#" > onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; > return false;">Full Trace</a> <div id="Application-Trace" > style="display: block;"> > <pre><code>#{RAILS_ROOT}/app/views/admin/arouse.rjs:3:in > `compile_template'</code></pre> </div> <div id="Framework-Trace" > style="display: none;"> > <pre><code>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</code></pre> </div> <div > id="Full-Trace" style="display: none;"> > <pre><code>#{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</code></pre> </div> </div> <h2 > style="margin-top: 30px">Request</h2> <p><b>Parameters</b>: > {"commit"=>"\346\216\250", > "id"=>"64"}</p> <p><a href="#" > onclick="document.getElementById('session_dump').style.display='block'; > return false;">Show session dump</a></p> <div id="session_dump" > style="display:none"><pre class='debug_dump'>--- :user_id: 1 :basket: > !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 > {} </pre></div> <h2 style="margin-top: 30px">Response</h2> > <b>Headers</b>: {"cookie"=>[], > "Cache-Control"=>"no-cache"}<br/> </body> > </html></pre> > > Any furthur hint? > > 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 Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/28/07, Bontina Chen <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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 > > -- > Posted via 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 Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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 Chandler > http://depixelate.comCOOL It works for page["score#{@p.id}"] So the syntax I used is the older version? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---