Templating with Leaf

Hello, i’m trying to do form with Fluent i don’t know what’s i’m missing.

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

What does CreatContactData look like? You’re getting an internal server error because one of your guards is failing. (Why are they optional anyway?)

If you’re supplying demo-name as the name in the form then in Swift the variable needs to look like let demo-name: String

Thanks the problem was resolved .
I have another question. i want to apply stylesheet to other page using Fluent .
For example this page for the form how i can dow it .

Depends on where the stylesheet lives? If it’s locally you can serve it with the FileMiddleware and just reference it in your Leaf template

what i mean by using the stylesheet . when i navigate to the new page how i can include using leaf.

When you navigate to a new page, that’s a separate request which you need a route for. In that route handler you can specify a template to use - just include the CSS in that template. Does that makes sense?

Thanks for you help.

1 Like