From: Kirk Haines Date: 2004-10-15T20:18:24+09:00 Subject: Re: IOWA Question (long because of code snippets) On Thu, 14 Oct 2004 23:29:13 +0900, Ben Schumacher wrote > Hello- > > I've been looking through the archives of this list some, but I'm > feel like I'm missing some critical (and probably simple) piece of > information. I'm trying to setup a page in IOWA where the URL > contains some a piece of information needed to render the page. > > Basically, I want to take URLs like: > > http://localhost:2000/details/FOO/ I obviously need to get more documentation up on the web, as you are the third person in as many days to ask me this. The exact implementation will depend on exactly what you are doing. If you use IRC, hop onto the #IOWA channel on freenode.net, and I'll help you sort out the precise details without boring the list. I try to monitor the channel most of the time while I am working. If not, email me at khaines@enigo.com or wyhaines@gmail.com or subscribe to the iowa-general mailing list hosted at rubyforge. In general, what you want is a change to Main.iwa. Is your app always going to start at /details? If so, eliminate the current Main.iwa and Main.html, and mail your Details.iwa and Details.html into Main.iwa and Main.html. Then all requests will start with Details, and it can mine the specific request path (in session.context.request.uri) for whatever details that it needs. If you will have other entry points than just /details, then you need to alter the current Main.iwa. If you haven't, take a look at Main.iwa. It's extremely simple in implementation. All it is doing is trying to find a match between the request path and an entry in the mapfile. If it finds one, that tells it what component to use. It's very easy to customize this in order to dispatch to the correct components if your needs are more complex. Let me know if that's what you need to do and I can help enlighten you on the process (and at the same time that'll help me develop text to explain the process). Thanks, Kirk Haines