similar to: Re: page.replace_html "#{var_containing_id_name}", :partial

Displaying 20 results from an estimated 1000 matches similar to: "Re: page.replace_html "#{var_containing_id_name}", :partial"

2006 Apr 07
2
Re: Re: page.replace_html "#{var_containing_id_name}", :partial
> you mean like this? > > def do_some_ajax_thing > <at> element_id = "content_div" > end > > do_some_ajax_thing.rjs > > page.replace_html <at> element_id, :partial => "edit" > > remember, the view templates have access to the attributes defined > in the controller Actually, its more like this: I have a list page. Each row
2006 Apr 07
2
page.replace_html "#{var_containing_id_name}", :partial => ''edit''
The subject line says it all. -- Is there a way to do something like: page.replace_html "#{var_containing_id_name}", :partial => ''edit'' That line of code does not work, but I would like to pass the name of a variable to page.replace_html. This variable would contain the id of the div I want to update. Anyone know if/how I could do that? Thanks! : ) Jason
2006 Apr 07
1
Re: page.replace_html "#{var_containing_id_name}",:partial
On 4/7/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > page.replace @user.id, :partial => "edit_form" Thanks a lot Chris. -- Unfortunately, it didn''t quite work when I tried it that way. However, when I tried it this way: page.replace_html "#{@user.id}", :partial => "edit_form" It worked! Thanks again!! : ) Jason
2006 Jun 24
6
Ajax fade effect
I have a list of categories, when I delete one of them, I want that item to fade and then get removed. So I do the following: 1. home_controller: def delete @category = Category.find_by_name(params[:name]) @element_id = @category.name Category.delete_all(["name = ?", @category.name]) end 2. delete.rjs: if @element_id page.visual_effect :fade, @element_id
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a list of projects: page.replace_html ''results'', ''<div>'' @projects.each do |p| page.insert_html :bottom, ''results'', p.name + "<br/>" end page.insert_html :bottom, ''searchresults'', ''</div>'' page.show
2006 Jul 20
6
replace_html + javascript
Hi all, This is my first post to the list, so I hope it gets through and I don''t do anything wrong :) Here''s the issue I''m having... I have an rjs that''s doing: page.replace_html ''myid'', :partial => ''my_partial'' And in my my_partial I have: <script type="text/javascript">
2006 May 25
2
page.replace_html
This is odd. When I call: page.replace_html ''formdiv'', :partial => ''listing'' from an rjs file it renders stuff like: \n \n \n test \n \n test , NY 12344 \n \n Phone: (999)999-8888 \n\t\t\n\n \n \t\n \t\thttp:// \n \t\n \n \n \n"); } catch (e) { alert(''RJS error:\n\n'' + e.toString());
2007 May 11
2
spec a replace_html with a partial
I wanted to use ARTS to add RJS in a behaviour driven way to my application, but I''m having some trouble asserting a replace_html with a partial. I''ve created a pastie (http://pastie.caboo.se/60694) which contains the RJS I want to spec, the spec which I already wrote and its failure message. I''m currently using RSpec-0.9.2
2008 Mar 12
2
RJS replace_html for all divs with a class
Hi- I want to do a bunch of html_replace ''s for a class of divs, not one single div and I want to replace the content with a partial. I can round them up using page.select, but cannot find something that will easily let me do something like: page.select(div.user).each do |d| d.replace_html render partial => y partial end Any ideas? Thanks, Dino
2006 Jul 24
2
BIG JS limit? Using replace_html with partials containing JS
Hello, It''s pretty hard giving a practical example on this one. I have a partial which contains some generated Javascript. Something like: order_screen.rhtml ------------------------------------------- <h1>Order</h1> <div id="order_part"> <%=render :partial=>''order_new'' %> </div> <h1>Ordered products</h1>
2006 Aug 07
1
Unable to page.replace_html from rjs
I am having problems updating a div defined in a partial using both Element.update and page.replace_html in an rjs. I can put a link_to_remote in the partial using an :update, and the div updates fine. Does anyone have any idea why this might be happening? In the partial: <div><div> . . <div id="question_<%=question.id%>_error"></div> . (if a
2006 May 08
1
replace_html on a select fails on IE and Opera
I am using an rjs file to do a page.replace_html on a select field as follows: @inrhtml = options_from_collection_for_select( @widgets, "id", "name") page.replace_html "type_select", @inrhtml I have it working on firefox and safari but it doesn''t work on IE and opera? My javascript defaults are up-to-date. I would appreciate any help. thx, -hkn --
2006 Jun 19
10
Trying to delete from a unordered list using ajax
I have a controller method as such: def delete @category = Category.find_by_name(params[:name]) @element_id = @category.name Category.delete_all(["name = ?", @category.name]) end (For the purpose of this exercise, category names are unique) I have the corresponding delete.rjs file: if @element_id page.remove :id => @element_id page.visual_effect :highlight,
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
First, BRAVO for this wonderful plugin: has_many_polymorphs ! Now my problem: 4 models : Collection, Page, Fragment, Belonging (which is the join table): 1 class Collection < ActiveRecord::Base 2 has_many_polymorphs :elements, 3 :through => :belongings, 4 :from => [:pages, :fragments, :collections], 5 :as => :collector, 6 :parent_order =>
2013 Jun 18
33
DomU suspension/hibernation
Hey, I thought there was supposed to be an ability for domU''s to be put into a hibernated state (E.g. current running tasks and memory) when dom0 is shutdown or rebooted. When I look in my /etc/default/xendomains file, I have the variable''s "XENDOMAINS_SAVE=/var/lib/xen/save" and "XENDOMAINS_RESTORE=true". However, when I reboot, I always have to restart my
2006 Apr 05
9
Is eval the only way?
Hi, I''m trying to write some methods which use a parameter to represent a Class name. A very simplistic example: def foo(class_name, conditions) x = class_name.find(:all, :conditions => "#{conditions}") end Unfortunately, this does not work. The only way around this problem that I can think of is to use eval: def foo(class_name, conditions) x = eval
2006 Sep 21
1
Saw this and thought warmly of everyone on the list
This type of thread always amazes me. With all of the work that the CentOS team does (gratis) I sometimes wonder why they take the time to respond to such ignorance and pigheadedness. Perhaps this is evidence that producing a product like this takes enormous patience and thus prepares them to deal with the Tuttle's of the world. Good job guys, Alex
2004 Nov 19
14
FAQ 32
What changes would I need to make if there is a 4th interface that is going to a DMZ Thanks Gene
2006 May 09
7
When to use optimistic locking?
Hi All, I''m having some trouble deciding when and how to implement optimistic locking. Let''s say I have a multiuser Rails app, and let''s say it stores, among other things "vital" customer information. The standard methods created by the Rails generate scaffold script look like this: def edit @customer = Customer.find(params[:id]) end
2005 Oct 14
6
Draggables onDragStart
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1027 bytes Desc: image001.gif Url : http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/b3c26edf/attachment.gif