From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.248.11 with SMTP id me11cs55qcb; Fri, 22 Oct 2010 17:13:19 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCNfamaK9ExCc0YjmBBoEpCMR7Q@googlegroups.com designates 10.150.72.10 as permitted sender) client-ip=10.150.72.10; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCNfamaK9ExCc0YjmBBoEpCMR7Q@googlegroups.com designates 10.150.72.10 as permitted sender) smtp.mail=rack-devel+bncCNfamaK9ExCc0YjmBBoEpCMR7Q@googlegroups.com; dkim=pass header.i=rack-devel+bncCNfamaK9ExCc0YjmBBoEpCMR7Q@googlegroups.com Received: from mr.google.com ([10.150.72.10]) by 10.150.72.10 with SMTP id u10mr2834913yba.81.1287792798327 (num_hops = 1); Fri, 22 Oct 2010 17:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:mime-version :received:received:date:in-reply-to:x-ip:references:user-agent :x-http-via:x-http-useragent:message-id:subject:from:to :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-transfer-encoding; bh=F3f0qzSm5TdcBF7bhH0pfXI26O+jPZ3SsiTuHzctipo=; b=N8KTWbnUXrM14jGLKIw0Zl9fN2frJs0jP8cGZJf/xgBXX+4GS1TjbM3Nxyim88y+ZA 3kRyNk24zAjdxfOhdQHkNM/WRn/N9B1quhmFIMH0lYrxdR1IO6JKDxuuW73kyLVP6ejy Wvgf2EkvZESuyXuY4OLH5/6z0cBM8dnO6vZKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:mime-version:date:in-reply-to:x-ip:references :user-agent:x-http-via:x-http-useragent:message-id:subject:from:to :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-transfer-encoding; b=ld71ejHZ4k1Zp9TNng1NQ+hCXAq2kuO5bRqJR2R+vRg6b2gW7WzBRsGaDICsxgVWfM a58lh6240QtIbxJIjhxvgedofo5VQZMgU+RzZAfZIwCf/jU3DMVVfZDFfZdj51wE6EWG L+jbfPnv5/f9gMRxEyzlbc/MP20TEg1L/1lh4= Received: by 10.150.72.10 with SMTP id u10mr596836yba.81.1287792796444; Fri, 22 Oct 2010 17:13:16 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.100.22.18 with SMTP id 18ls1248433anv.1.p; Fri, 22 Oct 2010 17:13:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.168.3 with SMTP id q3mr126912ane.49.1287792795656; Fri, 22 Oct 2010 17:13:15 -0700 (PDT) Received: by a4g2000prm.googlegroups.com with HTTP; Fri, 22 Oct 2010 17:13:15 -0700 (PDT) Date: Fri, 22 Oct 2010 17:13:15 -0700 (PDT) In-Reply-To: X-IP: 71.198.4.128 References: <9709dac9-9acd-4e4b-b1e6-eaa6e202ae36@37g2000prx.googlegroups.com> User-Agent: G2/1.0 X-HTTP-Via: 1.1 ipgi.x:800 (squid/2.6.STABLE21) X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10,gzip(gfe) Message-ID: <9e9892d7-ff49-4ac5-8246-5b8b8ea89016@a4g2000prm.googlegroups.com> Subject: Re: Links and Modular Apps From: andyl To: Rack Development X-Original-Sender: akleak@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks - your approach worked !! I think I'm going to create a link-rewriting middleware, so I can use unmodified Sinatra apps - but this is a nice intermediate step. - Andy On Oct 21, 11:19=A0pm, Sylvain Desv=E9 wrote: > The Rack URLMap changes the env so that '/app1' is moved from PATH_INFO t= o > SCRIPT_NAME. > > You need a helper in your Sinatra application to reconstruct paths : > > helpers do > =A0 def path_to(path) > =A0 =A0 request.script_name + path > =A0 en > end > > and then use it in your templates : > > > > 2010/10/22 andyl > > > I would like to use Rack to mount modular apps. > > > Using the 'map' statement in config.ru, I can mount an app just fine. > > > But - the links in my sub-apps don't work. > > > If I mount App1 on '/app1', and App1 has a link , > > it needs to render '/app1/page' instead of '/page'. > > > How do people get around this problem?? > > > Thanks, Andy > >