plush
plush copied to clipboard
How to use GroupBy?
Hi, sorry but I wasn't able to locate the docs for that (tried at https://godoc.org/github.com/gobuffalo/buffalo and also at the README but no examples).
I need to pair a slice into 2 per row pairs.
Ruby developer, learning Go and Buffalo at the same time..
Thanks!
Sounds like a good case for a custom helper ( https://gobuffalo.io/en/docs/custom-helpers ). If you give more info/an example of use, one of us may be able to help more with how you might make that helper.
That helper take a int (how many groups you want) and a slice to divide up.
https://github.com/gobuffalo/plush/blob/master/iterators_test.go
The tests explain it a bit clearer; but we need more docs there.
<%= form_for(contact, {action: "/contact"}) { %> <%= f.InputTag("Name") %> <%= f.InputTag("Email") %> <%= f.InputTag("Company") %> <%= f.TextArea("Description", {rows: 10, label: "Please let us what you are looking for in regards to training."}) %>
That’s a real world example. It takes the slice and breaks it into 2 so I can make two nice columns in HTML On Dec 13, 2018, 3:29 AM -0500, Matthew Clark [email protected], wrote:
Sounds like a good case for a custom helper ( https://gobuffalo.io/en/docs/custom-helpers ). If you give more info/an example of use, one of us may be able to help more with how you might make that helper. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Closing. It seems like it's an answered question.