Hi all, I''m a relative noob to rails so I apologize in advance for asking such a basic question. I am trying to do multiple AJAX calls using the link_to_remote helper or the JavaScript generator update_page. I have googled and read the docs for both, but can''t seem to figure out exactly what i need to do. Say I have the following html: <div id="div1"></div> <div><a href="somelink" id="link1">Insert text</a></div> When I click on the "Insert text" link I want that div to drop away (i.e. effect.drop), call an action that manipulates the id paramater a little bit (let''s say it will concatenate "This is" to the text) and then puts it into the div contents to produce something link this: <div id="div1">This is link1<div> This is of course not exactly what I am trying to do, but if I can get a little help with the process I think I can figure the rest out. And I''ve got the link dropping away working fine, but I don''t know how to do the update at the same time. Any help is appreciated. Bryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060714/c3bea719/attachment-0001.html
Bill Walton
2006-Jul-14 17:13 UTC
[Rails] Help with link_to_remote or javascript generator
Hi Bryan, Bryan Tec wrote:> I am trying to do multiple AJAX calls using the link_to_remote > helper or the JavaScript generator update_page. I have googled > and read the docs for both, but can''t seem to figure out exactly > what i need to do.If you can spare ten bucks, I highly recommend Cody Fausers PDF book(let) at: http://www.oreilly.com/catalog/rjsrails/?CMP=ILC-2RQ886833906&ATT=websor Two or three hours with that and you''ll be amazed at what you''ll be doing. Worth several times its price, IMO. Best regards, Bill
Bill, Thanks for the recommendation, the book is great and you''re right, I was up and running (with some extra knowledge to boot) in no time. One possibly obvious follow up question (addressed to anyone) which I also cant find the answer to - I know you can use :style => "font-size: 2em" or something of that nature to blanketly format the link_to_remote links, but what about adding hover effects like you would normally do using something like a:hover {font-weight: bold}? Bryan On 7/14/06, Bill Walton <bill.walton@charter.net> wrote:> > Hi Bryan, > > Bryan Tec wrote: > > > I am trying to do multiple AJAX calls using the link_to_remote > > helper or the JavaScript generator update_page. I have googled > > and read the docs for both, but can''t seem to figure out exactly > > what i need to do. > > If you can spare ten bucks, I highly recommend Cody Fausers PDF book(let) > at: > > http://www.oreilly.com/catalog/rjsrails/?CMP=ILC-2RQ886833906&ATT=websor > > Two or three hours with that and you''ll be amazed at what you''ll be doing. > Worth several times its price, IMO. > > Best regards, > Bill > > _______________________________________________ > 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/20060715/5bfbef04/attachment.html
Bill Walton
2006-Jul-15 17:05 UTC
[Rails] Help with link_to_remote or javascript generator
Hi Bryan, Bryan Tec wrote:> Thanks for the recommendation, the book is great and you''re right, > I was up and running (with some extra knowledge to boot) in no time.Congrats!> One possibly obvious follow up question (addressed to anyone) > which I also cant find the answer to - I know you can use > :style => "font-size: 2em" or something of that nature to blanketly > format the link_to_remote links, but what about adding hover > effects like you would normally do using something like > a:hover {font-weight: bold}?My personal preference for things like this is to look first to CSS. The starting point I use is http://www.w3schools.com Others will have differing opinions ;-) Best regards, Bill
Bryan Tec
2006-Jul-15 17:33 UTC
[Rails] Re: Help with link_to_remote or javascript generator
Sorry, I should have explained a little more about what I was doing. I know how to write the css for this if I was using a seperate stylesheet, but my link_to_remote command creates a variable number of links of the format id="pos#{i}" so I need the css to be inline and generated along with the links (at least the way I envision it). I use wc3 schools regularly, love the site, but couldn''t find anything about this specific issue. If I''m missing something relevant please point me to it. Thanks for the assistance! On 7/15/06, Bill Walton <bill.walton@charter.net> wrote:> Hi Bryan, > > Bryan Tec wrote: > > > Thanks for the recommendation, the book is great and you''re right, > > I was up and running (with some extra knowledge to boot) in no time. > > Congrats! > > > One possibly obvious follow up question (addressed to anyone) > > which I also cant find the answer to - I know you can use > > :style => "font-size: 2em" or something of that nature to blanketly > > format the link_to_remote links, but what about adding hover > > effects like you would normally do using something like > > a:hover {font-weight: bold}? > > My personal preference for things like this is to look first to CSS. The > starting point I use is http://www.w3schools.com Others will have differing > opinions ;-) > > Best regards, > Bill > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >