Forum: Ruby on Rails Fowler style "Two Step View" implementation

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.
Tim P. (Guest)
on 2007-04-03 15:30
Hey All

I have a situation where I would like to try and build in a Fowler style
"Two Step View" as the domain logic is always the same but the front end
needs to be tottaly a difffert look and feel.

In fowlers terms, i know rails uses a template view out of the box,
however is there some way I could put somthing in before it got to the
templating so that it enabled me to use a two step pattern?

Thanks

Tim
Andrew S. (Guest)
on 2007-04-03 15:50
(Received via mailing list)
Hello,

On 3 Apr 2007, at 12:30, Tim P. wrote:
> I have a situation where I would like to try and build in a Fowler
> style
> "Two Step View" as the domain logic is always the same but the
> front end
> needs to be tottaly a difffert look and feel.
>
> In fowlers terms, i know rails uses a template view out of the box,
> however is there some way I could put somthing in before it got to the
> templating so that it enabled me to use a two step pattern?

This might be what you're after:

http://blog.jayfields.com/2007/03/rails-presenter-...

Regards,
Andy S.
Tim P. (Guest)
on 2007-04-03 16:28
>
> http://blog.jayfields.com/2007/03/rails-presenter-...
>
> Regards,
> Andy S.

hmmm, that quite possibly might work. However from what i can tell it
does indeed abstact page logic (part one of two step) but then how could
I select  a template... I would have to think of some convention to do
this. Perhaps some subfolder derivitive of views named per presenter
class or somthing?

What do you think?

Tim
MichaelLatta (Guest)
on 2007-04-03 23:09
(Received via mailing list)
You can always render a partial who's name is defined by a param in
the URL or computed by the controller.

Michael

On Apr 3, 5:28 am, Tim P. <removed_email_address@domain.invalid>
Tim P. (Guest)
on 2007-04-03 23:21
MichaelLatta wrote:
> You can always render a partial who's name is defined by a param in
> the URL or computed by the controller.

I coudl indeed do this however I was looking for somthing a little
cleaner to be honest - somthing programatic that can be called properly
without having to worry about locals etc etc

How does the rendering work with the rails templating? maybe its
somthing i can adapt?

Cheers

Tim
This topic is locked and can not be replied to.