Forum: Ruby on Rails Components calling 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-08 10:40
(Received via mailing list)
Hi,

I'm relatively new to ruby and rails.  I would like to have a sidebar
component call one of several other constituent components.

I've run into some problems, and so I've pruned things back to a
relatively simple case.

I have a sidebar component.  Renders great.  In it's layout, I call
render_component for another component I would like in the sidebar.
This seems to work.  Right now, I end up with an error message in my
sidebar saying that the template is missing.  It shows a path to where
it expected to find the template.  I agree...that's where I expected
to put my template.

Here's the problem:  When I put my template in (regardless of content:
empty file, only HTML, etc) and reload I get a bus error and a core
dump.

I'm using WEBrick, Rail 1.0.0, ruby 1.8.4 on FreeBSD 5.4.

Any ideas on what I may be doing wrong?

Thanks,
  Brad
--
Bradley Mazurek
6f94c45fd92acbb3e21c328f6b35298a?d=identicon&s=25 Bradley Mazurek (Guest)
on 2006-03-08 19:52
(Received via mailing list)
So as I outlined earlier, doing a render_component() call within a
component layout seems to cause WEBrick to core dump for me.

I did some more playing and I found out that instead of doing this:

  application.html
    - render sidebar component
        - render tool1 component
        - render tool2 component

if I do this:

  application.html
    - render tool1 component
    - render tool2 component
    - render sidebar component
        - render tool1 component
        - render tool2 component

The page seems to render as I would expect.  No core dump.

Now if I revert to the original one, I don't get a core dump (as long
as it's within the same WEBrick process).

So, this appears to be some file loading issue, doesn't it?

How can I go about having the sidebar component ensure that the tool1
and tool2 components are loaded?  I tried doing require's, but that
didn't seem to work.

Any suggestions?

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