Sure, here it is:
(defn view-layout [& content]
(html
(doctype :xhtml-strict)
(xhtml-tag "en"
[:head
[:meta {:http-equiv "Content-type"
:content "text/html; charset=utf-8"}]
[:title "Datum"]]
[:body content])))
This was actually taken from an online tutorial with some changes (
http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html
)
More specifically, in the original tutorial there was an additional
intermediate step when the input was "parsed":
(parse-input a b)
with the function
(defn parse-input [a b]
[(Integer/parseInt a) (Integer/parseInt b)])(parse-input a b)
However in my case I'm just dealing with strings, so there's no "parseInt"
involved. So I assumed my input is strings-- which doesn't seem to be the
case, and there are no "parseString" methods that I could use instead.
Thank you,
Victor
On Fri, Sep 17, 2010 at 5:30 PM, Miki <[email protected]> wrote:
> My *guess* it's somehow connected to the code of "view-layout" since
> it shows the representation of the function "str".
> Can place the full code (including view-layout) somewhere?
>
> On Sep 17, 12:35 pm, Victor <[email protected]> wrote:
> > Hi all,
> >
> > I'm having a problem that may or may not be Compojure specific, so I
> > thought I'd try this group since the answer is probably easy- I am
> > just stuck.
> >
> > I am reading the string through a simple form
> >
> > (defn view-input []
> > (view-layout
> > [:h2 "Enter one datum:"]
> > [:form {:method "post" :action "/"}
> > [:input.datum {:type "text" :name "my_datum"}]
> > [:input.action {:type "submit" :value "Add"}]]))
> >
> > where the route for posting is
> >
> > (POST "/" [a]
> > (view-output a)))
> >
> > I then simply want to display what I entered and submitted (say I
> > typed the string "a").
> >
> > (defn view-output [a]
> > (view-layout
> > [:h2 (str "This is what you entered: " a)))
> >
> > However what I get is this:
> >
> > clojure.core$...@1e731e90
> >
> > Thanks in advance for your help!
> > Victor
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]<clojure%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en