Arch Stanton
2006-Apr-17 22:46 UTC
[Rails] Building Dynamic DOM Element IDs for RJS Templates
My element IDs are constructed using the object id. So . . . <div id="foo<%= foo.id %>" > <p><%= link_to_remote "Do Foo", :url =>{:action => "do", :id => foo.id} %> </div> How do, and can I, build that id in the RJS template? Also, can anyone recommend a good Ruby syntax book that would help me out with Rails? I know Java, so I don''t want a rehash of OO programming, I just want the meat of using Ruby. Thx. -- Posted via http://www.ruby-forum.com/.
Jeff Coleman
2006-Apr-18 02:11 UTC
[Rails] Re: Building Dynamic DOM Element IDs for RJS Templates
Arch Stanton wrote:> My element IDs are constructed using the object id. So . . . > > <div id="foo<%= foo.id %>" > > <p><%= link_to_remote "Do Foo", :url =>{:action => "do", :id => > foo.id} %> > </div> > > > How do, and can I, build that id in the RJS template? > > Also, can anyone recommend a good Ruby syntax book that would help me > out with Rails? I know Java, so I don''t want a rehash of OO > programming, I just want the meat of using Ruby. > > Thx.For learning Ruby you can''t go wrong with the Pickaxe book--Programming Ruby by Dave Thomas, from the Pragmatic Programmers. Jeff Coleman -- Posted via http://www.ruby-forum.com/.
Wilson Bilkovich
2006-Apr-18 02:14 UTC
[Rails] Re: Building Dynamic DOM Element IDs for RJS Templates
On 4/17/06, Jeff Coleman <progressions@gmail.com> wrote:> Arch Stanton wrote: > > My element IDs are constructed using the object id. So . . . > > > > <div id="foo<%= foo.id %>" > > > <p><%= link_to_remote "Do Foo", :url =>{:action => "do", :id => > > foo.id} %> > > </div> > > > > > > How do, and can I, build that id in the RJS template? > > > > Also, can anyone recommend a good Ruby syntax book that would help me > > out with Rails? I know Java, so I don''t want a rehash of OO > > programming, I just want the meat of using Ruby. > > > > Thx. > > For learning Ruby you can''t go wrong with the Pickaxe book--Programming > Ruby by Dave Thomas, from the Pragmatic Programmers. >Or "Ruby for Rails" by David A. Black. I highly recommend it.