On 03/15/2016 07:33 PM, Bryan Richter wrote:
> I think there is some confusion about how Widgets are used for Yesod
> Forms.
>
> Yesod Forms (I'll just use capital 'F' when I mean a "Yesod Form")
> hare pretty fancy. Some might say... TOO fancy. They take care of a
> lot of things:
>
> 1. Defining the Haskell data that comes out of them
> 2. Defining what the body of the <form> looks like
> 3. Defining how to validate the data they should accept
>
> One thing they explicitly do NOT do is generate a <form>. That's
> because they are used in a lot of different ways (because of how
> fancy they are).
>
> If a web designer wants to include a Form in a template, they must
> write it like this:
>
> <form enctype=#{enctype} method=... action=...>
> ^{formFooBar}
>
> In other words, they have to explicitly include a <form> element.
>
> Conversely, someone creating a custom Form should NOT add a <form>
> element to the Form's Widget.
>
> In the example code above, "formFooBar" is a Widget that comes from
> the Form. Note that like all Widgets, it is created in Haskell-land.
> Perhaps some day it can be generated automatically based on its name,
> but for now it is not, and a Haskeller has to provide it to the web
> designer. (Of course, the Haskeller and the web designer could be the
> same person...)
> I think it would be helpful to add reference to why this is being brought up and what's happening in the code that needs to be clarified. Certainly, it sounds great to both have our architecture use all of Yesod stuff optimally, be consistent and clear, etc. Are you saying that correct use of Yesod Forms will always generate the html <form> element?
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Dev mailing list [email protected] https://lists.snowdrift.coop/mailman/listinfo/dev
