Displaying 20 results from an estimated 1000 matches similar to: "page.insert_html and the :text argument"
2006 Jul 26
3
insert_html inserting fragment twice
Has anyone had trouble with inline RJS insert_html with the latest
version of Rails?
My problem is that insert_html inserts the html fragment twice. For
example,
render :update do |page|
page.insert_html :top, "some_list", "<li>booyow</li>"
end
would render "<li>booyow</li>" twice.
Thanks.
--
Posted via
2006 May 28
1
RJS template / page.insert_html problem
Hiall,
I have a rjs template which is calling page[:xxx].replace_html ... a
couple of times and this works perfectly. However, in the same rjs
file I have two calls to page.insert_html, which do not work. No error
in development.log, nor error message in browser, the new content for
the div simply isn''t changed at all.
This is my code:
...
action = "save_" +
2006 Jun 16
2
Receiving faxes and then sending them on
Hi,
I'm trying to setup a system where incoming faxes are received using
SpanDSP and then send on to another (remote) fax machine. The SpanDSP
part is working excellently, however I dont seem to be able to get
the forwarding part to work. Heres what I put into my extensions.conf:
exten => s,4,Answer()
exten => s,5,Set(FAXFILE=/tmp/fax-${UNIQUEID}.tif)
exten =>
2007 May 07
0
page.insert_html
Hi everyone,
In one of the actions i am using page.insert_html, t works fine in IE7
and Mozila. Is does not seem to work in IE6. Anyone aware of such
problems... i''m stuck... any help is appreciated; the element i am
inserting into is a <td>
page.insert_html :after, ''company''+params[:id].to_s, :partial
=>"group", :id => params[:id]
and the aprtia
2009 May 20
2
prototype.js insert issue
Hi,
I am trying to use the following lines in my RJS and have a problem
page.insert_html :bottom,:list,"<ul>"
#some conditions checks
page.insert_html :bottom,:list,"<li>Hello item</li>"
#some more code to add <li>s
page.insert_html :bottom,:list,"</ul>"
The problem I am having is the first line <<page.insert_html
2006 Apr 05
2
RJS and remote forms
I''ve run into what I think is a browser bug related to using
remote_forms pushed in an RJS update.
In my controller, I have an action that creates a new model and returns
a form for one of its children:
def create_party
party = Party.create
render :update do |page|
page.insert_html :top, ''party-list'', :partial => ''party_header'',
2006 Jun 07
0
using inline insert_html to generate uniquely named elements
Hello all,
I?m using some inline rjs to add content with a unique id like so:
In the <head>:
function add_fields() {
html = ''<div id="'' + new Date().getTime() + ''">'';
html += "<%= escape_javascript(render :partial => ''field_set'')
-%></div>";
new Insertion.After("whatever", html);
}
In
2008 Apr 23
0
Passing a hidden field to insert_html
I''m trying to pass a hidden field (item_property) to the add_link
helper function but when I do it the process threads start eating up
memory and my computer freezes.
[code=helper.rb]
def add_link(name)
link_to_function name do |page|
page.insert_html :bottom,:partial, :partial => ''item'', :object
=> Item.new(:item_property => "Some text")
2008 Sep 22
3
syntax error in RJS
I''m new to Ruby on Rails and came across a problem I could not solve
alone.
I''ve a pretty simple RJS file that looks like the following:
3.times do
page.insert_html :bottom, ''messages'', ''test''
end
page.call ''updateMessageWindow''
However this snippet gives a syntax error:
ActionView::TemplateError (compile error
D:/Eigene
2006 Jun 21
2
Using RJS to highlight one LI if using insert_html on an UL?
It seems common to use RJS for quickly adding and highlighting a list
that is having content added to it like this:
http://rafb.net/paste/results/Z3m32g48.html
... where "my_list" would be an UL and the partial would insert a LI.
Given that example, is there an easy way to highlight only the newly
inserted LI instead of the whole UL? The only way I can see to do it is
to give
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 03
6
Rjs $("aaa").insertHtml is not a function error
Hi,
I''ve searched the list and found that someone had the same problem as me
http://lists.rubyonrails.org/pipermail/rails/2006-May/043760.html
I''m have in my page a link like this
<%= link_to_remote ("Add
#{image_tag(''add.png'')}",:url=>{:action=>''addProduct''})%>
and in my controller
def addProduct
..................
2006 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following
page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>''
This works just find in safari and firefox. In IE and Opera it doesn''t
work so great. Any ideas? Am I doing something wrong here?
--
Posted via http://www.ruby-forum.com/.
2007 Dec 20
3
How-to spec this helper method?...
Hey gang,
I have this dead-simple method defined in a helper:
def add_category_link(name)
link_to_function name do |page|
page.insert_html :bottom, :categories, :partial =>
''category'', :object => Category.new
end
end
Where, and mostly how, would I spec this? I haven''t been able to find
how to stub the rjs in a helper spec, so
2006 May 08
3
Can you apply effects to elements create in same RJS file?
I am trying to create a new element in a list and highlight it.
I am doing the following in my rjs file:
page.insert_html :after, ''bananalist_header'', :partial => ''banana''
page.visual_effect :highlight, "banana#{banana.id}", :duration => 1
The first line creates a new element with the id= ''banana3'' say...
The second line then
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having
to feed the javascript directly to the page object as couldn''t find a
way to have insert_html work directly on the proxy object returned by
select.
However, that''s not the problem. The code for doing that is below and it
all works fine, except that a new line is being inserted after the
2006 Apr 09
4
Best RJS process for what I''m trying to do...
I just wanted to ping this off the list to get some advice since I''m
now pulling my hair out. Thanks in advance for taking any time to look
at this. It''s much appreciated. Now, my problem is my RJS is working
but it''s not inserting how I want it to insert. I have a partial I''m
rendering in my view that looks like this:
<ul
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
2009 Aug 07
2
calling a jQuery function from RJS/onclick
Hi,
I have the following jQuery function on the head of my page.
<script type="text/javascript">
jQuery.noConflict();
/* calling jNice on document ready */
jQuery(document).ready(function($)
{
$(''div.jNice'').jNice();
});
.....
</script>
On page load, this gets called correctly.
Now there''s a link on the page that lets me add more
2006 Mar 03
1
rjs isn''t update_page problems
i have a list of, for example, meal_names. Basically, I can submit a name
and the name I add shows up in the list.I had this working wehn i created an
actual add.rjs template for it. So feeling good about my self, I attempted
to move it all to the controller and use some update_page goodness. Now it
the ajax middle doesn''t happen. I don''t get any errors but the list