trailblazer / formular

Form builder for Ruby. Fast, Furious, and Framework-Agnostic.
MIT License
81 stars 17 forks source link

When using HAML formular render twice #52

Open elbouillon opened 6 years ago

elbouillon commented 6 years ago

I forked the exemple project et migrated templates to haml to show the problem (only with one field)

https://github.com/elbouillon/gemgem-sinatra

apotonick commented 6 years ago

What HAML version are you using? There's a bug with several versions!!!

elbouillon commented 6 years ago

I'm using Hamlit, in the example I did it's version 2.8.6 https://github.com/elbouillon/gemgem-sinatra/blob/ff2bec03e22fae7fad33d8b6262be1c349a45685/Gemfile.lock#L44

apotonick commented 6 years ago

@fran-worley Any ideas?

elbouillon commented 6 years ago

Do you want a screenshot?

Le mar. 2 janv. 2018 à 16:07, Nick Sutterer notifications@github.com a écrit :

@fran-worley https://github.com/fran-worley Any ideas?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/trailblazer/formular/issues/52#issuecomment-354786269, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC-0uTaxSHK3bHRmByGVjlKdoR1k3knks5tGkY-gaJpZM4RQFXh .

fran-worley commented 6 years ago

@elbouillon @apotonick Probably because it's not actually tested against haml... I would think it is probably related to #3

elbouillon commented 6 years ago

What I remember was that it render everything twice "fom" tag included

leoc commented 6 years ago

Hi there, I am having the same error with hamlit (2.8.8).

Is there some quick fix at the moment? Some version I can downgrade to, so that I can get around it?

I have looked into #3 but patching Formular::Builder#call does not seem to help. Maybe I misunderstood?

EDIT: It seems to be a problem of combination of gems. I tried to fallback to SimpleForm, but had the same behavior as with Formular. After replacing cells-hamlit with cells-haml the form is not rendered twice anymore. When I tried to use Formular the form was rendered twice again (despite using cells-haml), but the output did not contain Ruby array artifacts (e.g. "[", "]" and commas).

elbouillon commented 6 years ago

yeah, you can switch to slim 🤔

On Tue, May 15, 2018 at 9:36 AM, Arthur Leonard Andersen < notifications@github.com> wrote:

Hi there, I am having the same error with hamlit (2.8.8).

Is there some quick fix at the moment? Some version I can downgrade to, so that I can get around it?

I have looked into #3 https://github.com/trailblazer/formular/issues/3 but patching Formular::Builder#call does not seem to help. Maybe I misunderstood?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trailblazer/formular/issues/52#issuecomment-389072827, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC-0hHsgU1HY-O0FNn02zxje00fiUjEks5tyoWGgaJpZM4RQFXh .

konung commented 6 years ago

@elbouillon Mickael & @leoc Arthur -> see issue #63 for a workaround if you are still looking for HAML option. @apotonick - your insight would be appreciated (what the best way to implement this #63 more comprehensively).