Forum: Typo Passing info to sidebars

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.
8be5033bb156632452625c7026767339?d=identicon&s=25 Victor Jalencas (Guest)
on 2006-04-11 00:05
(Received via mailing list)
Hi all,

  this is a question for the sidebar experts. I'm interested in having
access, from the sidebars, to information from the main controller.
I.e., I'd like to write a couple of sidebars for the article controller,
and its display action, that show the main page article's trackbacks, or
  metadata, or comments count, or whatever. I could obtain the id from
the request and do a search for it, but ideally I should be able to
directly obtain the main controller's @article.

  Is there a way and I am missing something obvious, or should a
mechanism be ideated to pass the @article from the main controller to
the sidebars? I've tried using the flash object but doesn't work (or I'm
not using it correctly).

  Any ideas? TIA


cheers,
Victor
0196ff65610046d2f8ba58bc4a45f144?d=identicon&s=25 Piers Cawley (Guest)
on 2006-04-11 01:09
(Received via mailing list)
Victor Jalencas <victor-typo@carotena.net> writes:

>   Is there a way and I am missing something obvious, or should a
> mechanism be ideated to pass the @article from the main controller to
> the sidebars? I've tried using the flash object but doesn't work (or I'm
> not using it correctly).

The sidebar gets passed the 'contents' being rendered, which is a list
of the articles/pages/comments/whatever that's being displayed on the
current page. That's probably what you want.

Take a look at how the Amazon sidebar works.
8be5033bb156632452625c7026767339?d=identicon&s=25 Victor Jalencas (Guest)
on 2006-04-11 09:22
(Received via mailing list)
Excellent! thanks Piers!

Victor
This topic is locked and can not be replied to.