Displaying 20 results from an estimated 243 matches for "replace_html".
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'', {:file=>"front/new_title", :use_full_path=>true}
but these don''t
page.replace...
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 page.replace_html. This variable would contain the id
> > of the div I want to update.
> &...
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"> alert(''foo''); </script>
And this breaks my replace_html, and I get a javascript error in
firebug that looks like it'...
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 is a div
whose id is the id of the record it represents. When you click on the...
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 ''results...
2008 Aug 24
11
link_to_function check javascript attribute
...uot;Show details...", nil, :id => "show_details") do
|page|
page.visual_effect(:toggle_blind, :new_item_details)
if (page[:new_item_details].style.visibility == "none")
<----------------------------------------?????
page[:show_details].replace_html "Hide details"
else
page[:show_details].replace_html "Show details"
end
end %>
It tries to call style().visibility().== and this throws a javascript
error
--~--~---------~--~----~------------~-------~--~----~
You received this message...
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!
:...
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.toStrin...
2006 Jul 24
2
BIG JS limit? Using replace_html with partials containing JS
...form'' %> </p>
<%= submit_tag ''Modify'' %>
<%= end_form_tag %>
<%=
update_page_tag do |page|
page.delay(2) do
page.visual_effect :fade, ''order_message''
end
end
%>
<%=update_page_tag do |page|
page.replace_html ''order_lines_part'',
:partial=>''order_lines_index'',
:locals=>{ :fade_message =>
false}
end
------------------------------------------------------
I am having tons and tons of problems, because order_line_in...
2009 Dec 06
3
link_to_function or button_to_function memory usage
...act. I am implementing a button_to_function instead of doing an
ajax call to just edit/add/or cancel a contact. I am running into a
memory issue using the button_to_function or link_to_function.
I have this:
<%= link_to_function ''Edit Contact'' do |page|
page[:showcontact].replace_html :partial => ''/contacts/
ajaxshoweditcontact''
end %>
and the edit page also has this for the cancel:
_ajaxshoweditcontact.rhtml.
<%= button_to_function ''Cancel'' do |page|
page[:showcontact].replace_html :partial => ''/contacts/
ajaxshowcont...
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 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 link_to_remote...
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-dat...
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
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3Mb...
2006 Jul 21
1
RJS Failing
...nk was successfully created.''
redirect_to :action => ''list''
else
render :action => ''new''
end
end
---
#link_controller helper:
def update_link_list(new_link)
if @saved
page[''listing-status''].replace_html "You''ve created
#{@num_links} links in #{@num_cats} categories"
page[''no-links''].remove if @num_links == 1 && page[''no-links'']
page.insert_html :after, "category-#{new_link.category_id}",
:partial => '...
2006 Apr 11
5
RJS adds comment but doesn''t update form
...params[:id]).comments.create(params[:comment])
render :update do |page|
# show the new comment at the top of the comments display
page.insert_html(:top, "comments", :partial => "comment")
# quick and dirty way to empty the form that was just submitted
page.replace_html("commentform", :partial => "commentform")
end
--
Posted via http://www.ruby-forum.com/.
2006 Mar 07
12
rjs and partials
I''m trying to update a list, and having a hard time applying visual effects
to the latest element created. Here is what I''m doing.
===========================================
1) Creating an "item" via an action, then rendering the RJS template
2) RJS template looks like this:
page.insert_html :top, ''items'', :partial =>
2006 Mar 28
5
RJS call from controller issues javascript that doesn''t get evaluated by browser
Hi,
I''m on Rails 1.1 and I have a problem wit RJS
In my cotroller i have
==>>>
def show
@contact = Contact.find(params[:id])
render :update do |page|
page[:contactInfo].replace_html :partial=>"contactInfo"
end
end
<<<===
And my contactInfo partial looks like this and it''s placed inside a div element
==>>>
<table>
<tr>
<td><b><%=h @contact.first_name%></b> <%=h
@contact.l...
2006 May 25
5
Is there a way to abstract the updating of other parts of the page after an Ajax request without putting using the standard view file?
Hey all,
I''d like to abstract the process of updating different portions of the
page after an Ajax request has taken place. Rather than simply putting
the extra view logic in the standard rjs template, it seems to give
better separation if there is a split between the core view logic (ie,
inserting a row in a table), and updating any associated portions of
the page.
Is this possible? I
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