formular icon indicating copy to clipboard operation
formular copied to clipboard

When using HAML formular render twice

Open elbouillon opened this issue 7 years ago • 9 comments

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

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

elbouillon avatar Jan 01 '18 14:01 elbouillon

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

apotonick avatar Jan 01 '18 16:01 apotonick

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

elbouillon avatar Jan 01 '18 20:01 elbouillon

@fran-worley Any ideas?

apotonick avatar Jan 02 '18 15:01 apotonick

Do you want a screenshot?

Le mar. 2 janv. 2018 à 16:07, Nick Sutterer [email protected] 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 .

elbouillon avatar Jan 02 '18 16:01 elbouillon

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

fran-worley avatar Mar 07 '18 11:03 fran-worley

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

elbouillon avatar Mar 07 '18 11:03 elbouillon

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).

  • SimpleForm + Cells-hamlit ⇒ Rendering form twice, with Ruby array artifacts
  • SimpleForm + Cells-haml ⇒ Rendering correctly
  • Formular + Cells-haml ⇒ Rendering form twice, without Ruby array artifacts

leoc avatar May 15 '18 07:05 leoc

yeah, you can switch to slim 🤔

On Tue, May 15, 2018 at 9:36 AM, Arthur Leonard Andersen < [email protected]> 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 .

elbouillon avatar May 15 '18 16:05 elbouillon

@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).

konung avatar Oct 07 '18 00:10 konung