[racket] dispatch-rules

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Dec 8 18:07:59 EST 2011

It can handle them, it's just it means that you want 'dashboard' to be
called when the user visits "invoice%2Fdashboard"

If you want it to be called when the user visits "invoice/dashboard", then
you'd do ("invoice" "dashboard")

The list in dispatch-rules corresponds to elements of the URL path.

Jay

On Thu, Dec 8, 2011 at 4:03 PM, Jordan Schatz <jordan at noionlabs.com> wrote:

> The docs don't seem to specify, and I can't get it to work, so am I
> correct that dispatch-rules cant handle url patterns that contain
> slashes?
>
> ;;Doesn't work
> (define-values (static-dispatch static-url)
>  (dispatch-rules
>  ;;None of these functions take any arguments
>   [("invoice/dashboard") dashboard]
>   [("invoice/edit-company") edit-company]
>   [("invoice/export-customers") export-customers]
>   [("invoice/import-customers") import-customers]
>   [("invoice/create-customer") create-customer]
>   [("invoice/list-customers") list-customers]
>   [("invoice/export-invoices") export-invoices]
>   [("invoice/import-invoices") import-invoices]
>   [("invoice/create-invoice") create-invoice]
>   [("invoice/list-invoices") list-invoices]
>   [("invoice/payment-methods") payment-methods]
>   [("invoice/logout") logout]))
>
> -Jordan
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111208/8a1b4935/attachment.html>

Posted on the users mailing list.