Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed user to pick from a list to connect two users in YESOD
    primarykey
    data
    text
    <p>I need general guidance on how to structure a YESOD app. I would like to keep the app as "RESTful" in design as possible.</p> <p>The user searches all the other users to find one to connect with. I show the possible connections using Hamlet: </p> <pre><code> $forall (pid, person, mEmail, mPhone) &lt;- displayPeopleRecs &lt;p&gt; &lt;a href=@{CreateFundR pid}&gt;#{personNickName person} $maybe email &lt;- mEmail #{emailEmail email} $maybe phone &lt;- mPhone #{phoneNumber phone} </code></pre> <p>However, now when a user clicks on a link they go to the /createfund/ page as a GET request which is not what I want, I want to use POST or something else.</p> <p>Can anyone explain what the correct solution is here? Do I make a form for each person what the search produces and have a submit button for each possible person? That seems silly. Is it better to use Julius and change the onclick handler for the link to submit a POST instead of a GET to /createfund ?</p> <p>Here is the relevant line from my config/routes:</p> <pre><code>/createfund/#PersonId CreateFundR POST </code></pre> <p>By the way, I can see how to make this work by using a form and a submit button:</p> <pre><code> $forall (pid, person, mEmail, mPhone) &lt;- displayPeopleRecs &lt;p&gt; &lt;form method="post" action="@{CreateFundR pid}"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; #{personNickName person} $maybe email &lt;- mEmail &lt;br&gt; #{emailEmail email} $maybe phone &lt;- mPhone &lt;br&gt; #{phoneNumber phone} &lt;td&gt; &lt;input type="submit" value="Create Fund"&gt; </code></pre> <p>That will work for my needs, but I'd really like to allow the user to just click the link. Is this poor design? Or just a matter of taste?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload