Virtual-domain behaviour

Hi All,

I’m just throwing together a virtual domain behaviour, eg map
dir.example.com internally to example.com/dir/. I got a prototype
working, but when adding the code to select a child page based on the
host name I ran into a problem: I can’t see an easy way to get at the
request object.

I thought about making Behavior::Base#process to check for parent
behaviour, like in Behavior::Base#page_url, but that doesn’t work as
then the parent behaviour’s page would be rendered, not the correct
child (unless i followed the code incorrectly). My next thought is to
pass the request/response through when asking for the parent’s
behaviour, but this does couple everything together a bit much. Another
approach would be to make attr_accessor()s on behaviours and fill them
in after we get the parent page’s behaviour.

I’m going to try the attr_accessor method, and see how far i get, but i
was wondering to see what John and other people thought… Any
comments?

Bodhi

On 25/07/2006, at 7:08 PM, bodhi wrote:

Another approach would be to make attr_accessor()s on behaviours and
fill them
in after we get the parent page’s behaviour.

Of course, as soon as I sent this email, I scrolled up and noticed that
the accessors were already there (@_@)

Bodhi

bodhi wrote:

Of course, as soon as I sent this email, I scrolled up and noticed that
the accessors were already there (@_@)

I have repeatedly had the same problem with this mailing list. Let me
know if you find a workaround.

Jay

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs