I’ve run into a snag. I need to handle the display of elements on my
page and I want to use my Javascript event handlers on page load.
However, my BODY tag is trapped in my generic layout.
I’m thinking that I can put an onLoad on the BODY tag that will just
call a Javascript method called initializePage() and then provide this
initializePage() call in my specific page to call whatever handlers I
need to in order to display things correctly.
Something in the back of my head is screaming AJAX but not sure how I
would get that in.
I’ve run into a snag. I need to handle the display of elements on my
page and I want to use my Javascript event handlers on page load.
However, my BODY tag is trapped in my generic layout.
I’m thinking that I can put an onLoad on the BODY tag that will just
call a Javascript method called initializePage() and then provide this
initializePage() call in my specific page to call whatever handlers I
need to in order to display things correctly.
Something in the back of my head is screaming AJAX but not sure how I
would get that in.
Any thoughts?
Wes
FYI, this kind of Javascript scheme will work, but I think I just need
to make my template smarter, so I will do that instead.
Whoa - so content_for generates a block that can then be yielded to in
any of the enclosing templates?
WG
Wes-
Yeah, pretty sweet way to push dynamic content up from the partials
or templates into the layout. This is a very powerfull feature once
you start playing with it. Makes your layouts much more flexible and
reuseable because your normal views can specialize the layout.
Whoa - so content_for generates a block that can then be yielded to in
any of the enclosing templates?
WG
Wes-
Yeah, pretty sweet way to push dynamic content up from the partials
or templates into the layout. This is a very powerfull feature once
you start playing with it. Makes your layouts much more flexible and
reuseable because your normal views can specialize the layout.
Cheers-
-Ezra
As I sometimes say when I get excited - that is f-in ballz!
WG
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.