rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
From: "Sylvain Desvé" <sylvain.desve@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Links and Modular Apps
Date: Fri, 22 Oct 2010 08:19:36 +0200	[thread overview]
Message-ID: <AANLkTinzT9rOzUBsPd-8P6m=jnCdpP5ApeXxiBJLE_0Y@mail.gmail.com> (raw)
In-Reply-To: <9709dac9-9acd-4e4b-b1e6-eaa6e202ae36@37g2000prx.googlegroups.com>

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

The Rack URLMap changes the env so that '/app1' is moved from PATH_INFO to
SCRIPT_NAME.

You need a helper in your Sinatra application to reconstruct paths :

helpers do
  def path_to(path)
    request.script_name + path
  en
end

and then use it in your templates :

<a href='#{path_to('/page')}'>

2010/10/22 andyl <akleak@gmail.com>

> 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 <a href='/page'>,
> it needs to render '/app1/page' instead of '/page'.
>
> How do people get around this problem??
>
> Thanks, Andy

[-- Attachment #2: Type: text/html, Size: 1638 bytes --]

  reply	other threads:[~2010-10-22  6:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22  4:53 Links and Modular Apps andyl
2010-10-22  6:19 ` Sylvain Desvé [this message]
2010-10-23  0:13   ` andyl
2010-10-23  2:29     ` Yehuda Katz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTinzT9rOzUBsPd-8P6m=jnCdpP5ApeXxiBJLE_0Y@mail.gmail.com' \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/rack.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).