> I disagree with Josh on this one.
I disagree with me too. I thought about this for a while, and I
decided that `res.render` was pretty good.
> I've actually been wanting to add `.render` to union. Potentially through
> consolidate.js (or maybe another lightweight abstraction). We should at
> least have `res.html` and `res.text`.
This would be pretty sweet.
--Josh
On Feb 13, 9:24 am, Charlie Robbins <
charlie.robb...@gmail.com> wrote:
> Kevin,
>
> I disagree with Josh on this one. `res.render()` seems like a fine
> abstraction. Fundamentally it doesn't do much differently than `res.json()`
> which already exists. The fundamental problem with current `res.render`
> implementations is that they tightly couple themselves to the application
> instead of simply taking more options and using sane defaults.
>
> I've actually been wanting to add `.render` to union. Potentially through
> consolidate.js (or maybe another lightweight abstraction). We should at
> least have `res.html` and `res.text`.
>
> --Charlie
>
>
>
>
>
>
>
> On Mon, Feb 13, 2012 at 10:18 AM, Kevin Rockwood <
ke...@rockwood.me> wrote:
> > Thanks for the info Josh. I'd like to create a plugin to help with view
> > rendering. Do you know of any already in development. I don't want
> > to duplicate any work that's already been done.
>
> > You mentioned that res.render() isn't a good abstraction. What would you
> > suggest as an alternative?
>
> > -Kevin
>
> > On Fri, Feb 10, 2012 at 10:48 PM, Joshua Holbrook <
josh.holbr...@gmail.com
> > > wrote:
>
> >> Hi Kevin,
>
> >> Welcome to the mailing list! Glad to hear you're enjoying flatiron.
>
> >> I haven't done much rendering with plates actually (believe it or
> >> not), but I do know that it's not coupled to anything in particular.
>
> >> What you're doing will certainly work fine. If you wanted something a
> >> little more like express's .render convenience method, you could write
> >> a plugin that adds a `.render` to your application. I probably
> >> wouldn't try attaching it to res; that seems like the wrong
> >> abstraction to me.
>
> >> Cheers,
>
> >> --Josh
>
> >> On Fri, Feb 10, 2012 at 12:40 PM, Rockwood <
ke...@rockwood.me> wrote:
> >> > Hi all.
>
> >> > I've been playing around with flatiron the past couple days and it
> >> > looks really awesome. I've started running into the limits of
> >> > complexity that Express can handel, and Flatiron looks like it will
> >> > solve many of those issues.
>
> >> > I'm trying to figure out the best way of managing views server-side.
> >> > Express has the convenience of res.render('view.file', {data}), and
> >> > I'm wondering how that translates to Plates. Being that Plates needs
> >> > to be both client and server compatible, would it be better to create
> >> > a separate flatiron plugin that loads a view file and passes that to
> >> > Plates along with a map and data object?
>
> >> > Here's a simple gist for illustrationhttps://
gist.github.com/1792543.
>
> >> --
> >> Joshua Holbrook
> >> Engineer
> >> Nodejitsu Inc.
> >>
j...@nodejitsu.com
>
> > --
> > Kevin Rockwood |
www.rockwood.me