Re: Nested routes problem

26 views
Skip to first unread message

James Reeves

unread,
Mar 17, 2013, 2:20:53 PM3/17/13
to Compojure
On 17 March 2013 16:33, Matthew Hill <matt...@gmail.com> wrote:
So far I've tried doing:

(defn controller-routes [locale]
  (routes
    ((home/c-routes locale)
     (search/c-routes locale))))

Almost right, but you've got too many parentheses. Your code is essentially:

  (let [home   (home/c-routes locale)
        search (search/c-routes locale)]
    (routes (home search)))

So you're calling your home routes with your search routes as an argument. What you want is:

  (defn controller-routes [locale]
    (routes
     (home/c-routes locale)
     (search/c-routes locale)))

- James
Reply all
Reply to author
Forward
0 new messages