Forum: Ruby on Rails RJS & nested divs

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Richard (Guest)
on 2006-06-11 01:28
I'm a newbie and I've been trying to figure this out for a little while
now, hopefully someone can point me in the right direction.

<div id="new">

<div id="new"><div id="item1"></div></div>
<div id="new2"><div id="item1"></div></div>

With RJS in case1, I can access "new" with page['new']. What would the
RJS syntax be if I wanted to access "item1" in "new2"?
Daniel H. (Guest)
on 2006-06-11 02:28
(Received via mailing list)
Instead of item1, can you name your divs new-item1 and new2-item1?  It's
really not a good idea to have more than one element with the same ID.
David (Guest)
on 2006-06-11 02:35
(Received via mailing list)
I'm doing this one way and I want to make sure that it's not as messy as
it feels.

I want to ensure that certain controller methods are only called when
params are passed in from the form on my site.  In my application.rb, I
have a method called log_current_action which stores the current
controller and action in a session param and moves this info into
last_controller and last_action so that I know from where the user came
the app.  In application.rb, I call this method from before_filer
:log_current_action before every request is processed.

I want to make sure that a user is processing the forms correctly and my
method does work, but it feels a little clumsy.  Any advice?

David M (Guest)
on 2006-06-11 17:54
(Received via mailing list)
Is there any advice on this?  I'm a bit concerned.

This topic is locked and can not be replied to.