rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
From: andyl <akleak@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: Links and Modular Apps
Date: Fri, 22 Oct 2010 17:13:15 -0700 (PDT)	[thread overview]
Message-ID: <9e9892d7-ff49-4ac5-8246-5b8b8ea89016@a4g2000prm.googlegroups.com> (raw)
In-Reply-To: <AANLkTinzT9rOzUBsPd-8P6m=jnCdpP5ApeXxiBJLE_0Y@mail.gmail.com>

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 pm, Sylvain Desvé <sylvain.de...@gmail.com> wrote:
> 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 <akl...@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
>
>

  reply	other threads:[~2010-10-23  0:13 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é
2010-10-23  0:13   ` andyl [this message]
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=9e9892d7-ff49-4ac5-8246-5b8b8ea89016@a4g2000prm.googlegroups.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).