Displaying 20 results from an estimated 7000 matches similar to: "RJS replace_html for all divs with a class"
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 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 Apr 03
5
RJS Queue
Hi,
I''ve been able to succesfully queue page.visual_effect commands in my
RJS templates. Each command will wait to execute until the previous
command is done executing.
But I''d also like to execute a page.replace_html command AFTER the
page.visual_effect commands. I have a series of five DIVs:
div1
div2
div3
div4
div5
When the user clicks on div1, a page.visual_effect
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
Re: page.replace_html "#{var_containing_id_name}", :partial
Jeff Coleman <progressions@...> writes:
>
> Jason Tuttle wrote:
> > 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
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',
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());
2006 Mar 13
3
problem updating mulitple divs with ajax
i''m having some issues updating multiple divs via ajax. perhaps someone can
lend some assistance.
i''ve got 2 divs:
user_list and user_form.
when a person clicks the "edit this user" or "add new user" link the
user_form div is updated via an ajax call and the form is shown in the
user_form div.
this form is a remote form. it submits to either the update
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
2006 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in
the helper below (everything was in the controller). I can successfully
create a new link but I get a TypeError when I leave all form fields
blank -- I expect to see validation error messages.
---
#link_controller.rb:
def create
link = Link.new(params[:link])
saved = link.save
num_links = Link.find(:all).size
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 Mar 18
9
RJS - not working in IE
I searched thru all the postings about RJS, and I didn''t find one person
who complained of problems specific to IE, but that''s what I''ve got.
My environment is:
Rails 1.0 + RJS Plugin
Updated Javascripts to Scriptaculous 1.5.3 (for evalScripts support)
Monkeypatched in_place_editor to support evalScripts
I have just started using RJS, and I have two .rjs templates.
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 Mar 22
1
RJS - Still not working in IE
The previous thread on this topic got a little disjointed, so I thought
I''d summarize the issue again, in hopes that someone could help. To
re-iterate, this rjs works in Firefox and Safari on Mac, and in Firefox
on Windows. It fails, in IE on Windows. The failure is that the second
page.replace_html seems to do nothing.
My environment is:
Rails 1.0 + RJS Plugin
Updated
2006 Nov 04
1
Dynamically updating a sortable list using RJS
I''ve got the following sortable list in one of my views:
<ul id="sortable_list" class="sortable_list">
<%= render(:partial => ''section'', :collection => @sections) %>
</ul>
<div class="new_section" id="new_section">
<%= form_remote_tag(:url => {:action =>
2006 Jul 20
5
RJS where to put helper method?
Hi,
If I want to have helper method for my rjs, where''s the best place to put
it?
so for example:
--- bla.rjs:
page.replace_html ...
page.visual_effect ...
--- somewhere: (currently I put in application_helper.rb)
def replace_with_effect(page)
page.replace_html ...
page.visual_effect ...
end
--- bla.rjs:
replace_with_effect page
and is there a way to define the helper so we
2009 Apr 20
1
RJS sporadic error message
I have this form that allows a user to enter a username and save it,
assocciating your profile with theirs via an id. A list gets updated and
a partial is displayed. The problem is that when I hit the submit button
to this form to make this all happened I (sometimes, but more often then
not) get an RJS error that reads:
TypeError: Cannot set property ''innerHTML'' of bull.
I hot
2006 Jun 27
2
Bug in Firebug or in RJS? Or something else?
I''m getting a really strange result using RJS page.replace_html and wonder if anybody knows anything that could help me figure it out.
I''m rendering a partial in a loop in edit.rhtml that puts a set of <div>s on the page, each <div> containing a checkbox_tag with an associated observe_field and a text_field_tag also with an associated observe_field. When the
2006 Feb 14
2
Inline list editing with RJS: best practices
I wanted to get the community opinion on the best way to use partials and
inline list (<li>) editing.
I have a very common scenario where a list is rendered:
--- index.rhtml ---
<ul>
<%= render :partial => ''item'', @collection => @items %>
</ul>
--- _item.rhtml (simplified) ---
<li id="item_<%= item.id %>">
<div