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. case1 <div id="new"> </div> case2 <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"? -- Posted via http://www.ruby-forum.com/.
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. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Richard Sent: Saturday, June 10, 2006 11:29 AM To: rails@lists.rubyonrails.org Subject: [Rails] RJS & nested divs 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. case1 <div id="new"> </div> case2 <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"? -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
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 form 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 in 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? Thanks, David
Is there any advice on this? I''m a bit concerned. Thanks, David> 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 form > 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 in > 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? > > Thanks, > David > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >