Skip to content

Instantly share code, notes, and snippets.

@mkaschenko
Created May 3, 2016 10:23
Show Gist options
  • Select an option

  • Save mkaschenko/477bfa45bf0d90a9d35c58cdce8a532e to your computer and use it in GitHub Desktop.

Select an option

Save mkaschenko/477bfa45bf0d90a9d35c58cdce8a532e to your computer and use it in GitHub Desktop.
(defn show-page
[request]
(let [page-number (read-string (get-in request [:path-params :id]))]
(if (and (> page-number 7) (not (session/authenticated? request)))
(ring-resp/redirect "/sign-in")
(ring-resp/response (views/book-page book page-number)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment