Can anyone point me to an example of how to use the Insertion.Before technique? I''ve just begun trying to use AJAX and worked through Curt''s "Ajax on Rails". The description in AWD of what this does is just what I need, there''s no example of how to use it, and I''m getting no joy using Google. Any help is tremendously appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/73a45682/attachment.html
http://www.sergiopereira.com/articles/prototype.js.html search for "Insertion.Before" in the page On 4/3/06, Bill Walton <bill.walton@charter.net> wrote:> > Can anyone point me to an example of how to use the Insertion.Beforetechnique? I''ve just begun trying to use AJAX and worked through Curt''s > "Ajax on Rails". The description in AWD of what this does is just what I > need, there''s no example of how to use it, and I''m getting no joy using > Google. Any help is tremendously appreciated. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/53c66369/attachment.html
Hi Chris, I appreciate your response. I''d found that through Google but there''s no example of how I''d use it in Rails. Curt''s "Ajax on Rails" article works great with lists, but I can''t get it to do much of anything good with tables. ;-( Despite all the praise I''ve seen for how easy Rails makes Ajax, I can''t find much in the way of examples / tutorials. Thanks again, Bill ----- Original Message ----- From: Chris Hall To: rails@lists.rubyonrails.org Sent: 2006-04-03 12:14 PM Subject: Re: [Rails] AJAX Insertion.Before http://www.sergiopereira.com/articles/prototype.js.html search for "Insertion.Before" in the page On 4/3/06, Bill Walton <bill.walton@charter.net> wrote: Can anyone point me to an example of how to use the Insertion.Before technique? I''ve just begun trying to use AJAX and worked through Curt''s "Ajax on Rails". The description in AWD of what this does is just what I need, there''s no example of how to use it, and I''m getting no joy using Google. Any help is tremendously appreciated. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails ------------------------------------------------------------------------------ _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/8a86b8b7/attachment.html
without knowing exactly what you want to do, i can only provide a simple example. hopefully this is what you are after. <%= link_to_remote( "Add", :update => "xyz", :url => { :action => "add" }, :position => "before") %> what this will accomplish is to call the add action on the controller and then insert the returned content before the element with the id of "xyz" so if i had the following as my update element: <span id="xyz">bar</div> and my remote link returned "foo" the result would be: foo<span id="xyz">bar</span> if you were to look at the source, you would see something like: <a href="#" onclick="new Ajax.Updater(''xyz'', ''/controller/add'', {asynchronous:true, evalScripts:true, insertion:Insertion.Before}); return false;">Add</a> however, as tables have been known to be flaky across browsers in regards to ajax, I have no idea if this would even work. On 4/3/06, Bill Walton <bill.walton@charter.net> wrote:> > Hi Chris, > > I appreciate your response. I''d found that through Google but there''s no > example of how I''d use it in Rails. Curt''s "Ajax on Rails" article works > great with lists, but I can''t get it to do much of anything good with > tables. ;-( Despite all the praise I''ve seen for how easy Rails makes Ajax, > I can''t find much in the way of examples / tutorials. > > Thanks again, > Bill > > ----- Original Message ----- > *From:* Chris Hall <christopher.k.hall@gmail.com> > *To:* rails@lists.rubyonrails.org > *Sent:* 2006-04-03 12:14 PM > *Subject:* Re: [Rails] AJAX Insertion.Before > > http://www.sergiopereira.com/articles/prototype.js.html > > search for "Insertion.Before" in the page > > On 4/3/06, Bill Walton <bill.walton@charter.net> wrote: > > > > Can anyone point me to an example of how to use the Insertion.Beforetechnique? I''ve just begun trying to use AJAX and worked through Curt''s > > "Ajax on Rails". The description in AWD of what this does is just what I > > need, there''s no example of how to use it, and I''m getting no joy using > > Google. Any help is tremendously appreciated. > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/fcc17667/attachment.html