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 http://www.ruby-forum.com/.
I found the answer. I had :complete => ''eval(request.responseText)'' in my link_to_remote function, which was causing it to evaluate a second time. This behaviour is new in Rails 1.1. mofo mofo wrote:> 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 http://www.ruby-forum.com/.
hi can you explain more what you meant? basically what your
link_to_remote looks like?
mine is simply
<% link_to_remote "view comments", :url => { :controller =>
''main'',
:action => ''test_rjs'', Lid => @myObj%>
my comments get inserted twice.
THANKS@!
mofo mofo wrote:> I found the answer.
>
> I had :complete => ''eval(request.responseText)'' in my
link_to_remote
> function, which was causing it to evaluate a second time. This
> behaviour is new in Rails 1.1.
>
> mofo mofo wrote:
>> 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 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
-~----------~----~----~----~------~----~------~--~---
solved it, i just use form_to_remote. -- 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 -~----------~----~----~----~------~----~------~--~---