charlie.caroff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-02 22:10 UTC
help with partials
Hi, I am trying to get a partial to update on a page, but I can''t get it to work. Here''s the relevant part of my controller: def update_deleted @listing = Listing.update(params[:id], :deleted => "1", :position => "0") end Here''s the relevant part of my view: <%= render :partial=>"deleted_web_list" %> Here''s the partial _deleted_web_list.rhtml: <div id="deleted_web_listing" class="left_column_listing"> <%= render :partial=>"show_deleted_web_listings" %> </div> Here''s the partial _show_deleted_web_listings.rhtml: <% for listing in @deleted_listings %> <div class="box_left"> <div class="x_image"> <%= link_to_remote(image_tag("restore.gif", :size => "44x13", :border => "0" ), :url => { :action => ''restore_deleted'' , :controller=> :admin, :id => listing.id}) %> </div> <div class="search_result_url_to_show"><%h(truncate(listing.url_to_show, 22)) %></div> <div class="search_result_description"><%h(truncate(listing.description, 35)) %></div> </div> <% end %> When I perform the action "update_deleted" in my controller, the database updates properly. When update_deleted.rjs looks like this, I see this replacement text without refreshing my browser: page.replace_html ''show_deleted_web_listings'' , ''<div>this is the replacement text</div>'' But when I try to use my partial to replace text, it does not work. The database updates properly, but my partial _deleted_web_list.rhtml does not show up, completely refreshed, when I perform my action "update_deleted" - page.replace_html ''show_deleted_web_listings'' , :partial => ''deleted_web_list'' Any ideas? Charlie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
just replace_html ''show_deleted_web_listings'' , :partial => ''deleted_web_list'' no page. -- 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 -~----------~----~----~----~------~----~------~--~---
charlie.caroff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-06 01:37 UTC
Re: help with partials
Hi, thanks. This does not work for me. I get this error: ctionView::TemplateError (undefined method `replace_html'' . . . On Jun 2, 11:06 pm, Keynan Pratt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> just > > replace_html ''show_deleted_web_listings'' , :partial => > ''deleted_web_list'' > > no page. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---