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.
A049c3597983fdaaa2af2b0010c49abc?d=identicon&s=25 Tim Perrett (timperrett)
on 2007-04-03 13: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
72ee7b478a235f646c3495f03ebbe676?d=identicon&s=25 Andrew Stewart (Guest)
on 2007-04-03 13:50
(Received via mailing list)
Hello,

On 3 Apr 2007, at 12:30, Tim Perrett 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 Stewart
A049c3597983fdaaa2af2b0010c49abc?d=identicon&s=25 Tim Perrett (timperrett)
on 2007-04-03 14:28
>
> http://blog.jayfields.com/2007/03/rails-presenter-...
>
> Regards,
> Andy Stewart

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
588ab1c0a5610a7e160a3b101abb91e6?d=identicon&s=25 MichaelLatta (Guest)
on 2007-04-03 21: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 Perrett <rails-mailing-l...@andreas-s.net>
A049c3597983fdaaa2af2b0010c49abc?d=identicon&s=25 Tim Perrett (timperrett)
on 2007-04-03 21: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.