Forum: Ruby on Rails Building Dynamic DOM Element IDs for RJS Templates

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Arch S. (Guest)
on 2006-04-18 02:46
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.
Jeff C. (Guest)
on 2006-04-18 06:11
Arch S. 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 T., from the Pragmatic Programmers.

Jeff C.man
Wilson B. (Guest)
on 2006-04-18 06:17
(Received via mailing list)
On 4/17/06, Jeff C.man <removed_email_address@domain.invalid> wrote:
> >
> > 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 T., from the Pragmatic Programmers.
>

Or "Ruby for Rails" by David A. Black.  I highly recommend it.
This topic is locked and can not be replied to.