Forum: Ruby on Rails Rendering objects

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3dcb0c9fdc4e2b501c8177d91a5869a2?d=identicon&s=25 Heino H. Gehlsen (Guest)
on 2006-02-04 02:09
(Received via mailing list)
So, Ruby is OO all the way, but in Rails we can?t render an object?

Having retyped way too many calls to ActionViews render method with
various options, I finally figured, why not make it possible to actually
render customized objects, which could encapsulate the often messy code,
that I often ended up writing partly in the controller and partly in the
view - using instance variables, and typing ?if? way too often in the

What I ended up with were ?Ren(d)jects?, objects capable of being

I have already made a functional plugin using only 66 lines of actual
code (well, actually only 28, but I thought a few basic helpers would be
nice ;-), and I would really like some feedback?

Source and documentation is avalible at The
documentation includes a brief introduction to the concept of Rendjets -
and of cause a few small examples, which show how to use them. To some,
the examples will perhaps at first sight seem at bit too complex, but
think code reuse and easier debugging!

Having tried using Ren(d)jects when generating sidebars based on
multiple independent blocks, I already find encapsulating partial
rendering pretty neat ? from now on such blocks have to be very complex
before I?ll end up using components?

Kind regards,
Heino H. Gehlsen
F68e4842b0a5487678e26046fdb2fdf3?d=identicon&s=25 softwareengineer 99 (Guest)
on 2006-02-04 06:15
(Received via mailing list)
  I have been looking for something like this.

  Will try out over the weekend and let you know.

This topic is locked and can not be replied to.