[Rote-devel] Rote development
Jonathan Paisley
jp-www at dcs.gla.ac.uk
Thu Dec 15 06:46:20 EST 2005
Your points below cover both aspects from my earlier email ([a]
static ERB rendered pages and [b] dynamic generation using normal
rails). I've annotated my answers accordingly.
On 15 Dec 2005, at 11:06, Ross Bamford wrote:
> I'm just starting to put this together, and here are a few things I'm
> thinking right now:
>
> * Instead of taking source files to be all 'rhtml' files, I think
> we need
> to instead find all ActionController subclasses, and then find out
> what
> actions they support. This is assuming we're following Rails
> conventions
> quite closely.
Sticking with my interpretation, I think this is confusing parts [a]
and [b]. [a] requires scanning for rhtml files, and running through
some kind of ActionController provided by rote, whereas [b] is
dealing with creating a snapshot of a rails site.
> * In either case, we need to think about how we'll calculate
> dependencies
> without having to run all the code.
[a,b] For many cases the dependencies can be calculated each time the
code is run. The first time the dependencies don't matter so much
because the target doesn't exist, so it has to be built.
> * The 'Root pages' you mentioned - do you mean like having an
> 'index.rhtml' (for example) as the only definite page, and then
> calculating others by spidering from there.
[b]
Yep, or perhaps just providing a site-relative url. e.g.:
/photos
We'd take that and map it in the same way rails does to the 'index'
action on the PhotosController. We'd call that to generate the page,
parse links from the result, and repeat.
> * How are we going to specify controllers, and how will they affect
> URLs?
> Are we going to follow rails, and have a page's target URL
> determined by
> it's controller and action. Do we incorporate the template's
> basename too,
> or ignore that for the target path?
[b] Use the Rails Routing module to determine URLs, so the target URL
would be prettily formatted as /controller/action/id, for example. It
might be necessary to do some rewriting to add .html to get mime
types correct.
[a] .rhtml -> .html
> * Alternatively ... what? we could switch the pattern, and have
> each page
> select it's controller somehow (_slightly_ odd I think). Apart from
> that,
> where are the mocked requests going to come from?
I think this confuses [a] and [b].
[a] is a special case, where we drive template evaluation by
examining the filesystem for .rhtml files in a 'pages' subtree.
[b] is concerned with the static snapshotting of a rails site, and
would use all the normal rails techniques to do so.
My idea of the split between [a] and [b] is quite probably broken,
but it's what I'm thinking of at the moment.
:)
More information about the Rote-devel
mailing list