Forum: Ruby on Rails Re: Problem rendering components

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.
6f94c45fd92acbb3e21c328f6b35298a?d=identicon&s=25 Bradley Mazurek (Guest)
on 2006-03-11 06:27
(Received via mailing list)
Hi Daniel,

Interesting point.  But let's look at this from another perspective
rather than @title.  In your component template, if you access
controller.controller_name or controller.action_name what should you
see?  Since you are in the component controller, I would argue that
you should see things from the perspective of the component
controller.

As well, since components appear to be intended to be isolated siloes
of functionality, having the @title use the @title from it's parent
context would not use normal OO inheritance, but would use some sort
of runtime context inheritance.  From that perspective it seems a
little difficult to articulate how it would work in all cases (what it
would get from where and when), and increases the coupling between the
component and it's surroundings.

I had my own issues with components a few days ago that were never
resolved and left me abandoning the use of components.

Could you explain your own situation a bit more to explain why you
want to use the @title from your original controller inside the
component?  It would help me look at my own situation from another
context.

I ask because it appears that people don't seem to use components.

I was trying to call a component from within another component (a
sidebar with various constituent pieces in the sidebar), but doing
this was causing a ruby core dump for me.  All the IRC and mailing
list questions I posted never got a reply.  It almost appeared that
people aren't using components, and I was hitting on a relatively
simple bug simply because people don't use them.  I made a bug report
and haven't heard anything further.

  http://dev.rubyonrails.org/ticket/4152

Good luck,
  Brad
--
Bradley Mazurek
This topic is locked and can not be replied to.