On 2/10/08, Thufir <hawat.thufir / gmail.com> wrote:
> On Feb 10, 9:20 am, Phlip <phlip2... / gmail.com> wrote:
> Is there a more ruby-ish or rails way?  Somehow, I can't think that
> _why would do it like that, it seems kludgy.
>
> Let me rephrase the question:
>
> What's the optimal technique (idiom?) for getting output from the
> model?

If you want to store the output to a log file or something similar,
use the logger object (for example, logger.info).

Otherwise, there isn't a simple way of getting HTML from the model and
that's because the model never speaks directly with the view. It's the
controller's job to do that. If you look closely, you'll see that you
completely skipped the controller.

As a hint, try using scaffolds and modify one to suit your needs. It
might give you a good head-start, but remember that sometimes you
might have to seriously tweak them.

-- 
Andrei Maxim
http://andreimaxim.ro