-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Haml support and teest #63
base: master
Are you sure you want to change the base?
Conversation
Ignore pull request #62 - I did git add . from wrong directory level 🤕 |
Thanks so much for adding this - I never quite got around to adding 'formal' support for it! |
Full stop. :( And will need to figure out a way around this first. I'll dive into formular later this week :) |
@konung we have the same issue with erb actually and why we had to add a blockless api see the erb tests https://github.com/trailblazer/formular/blob/master/test/fixtures/comment/erb/show/view/show.erb |
Thank you Fran This rabbit hole is insane. I figured out a temp solution and even the cause, but I'm not sure where to implement a permanent solution inside formular. Problem Reference Reading
And these HAMLIT (not haml) issues
Ad-Hoc Solution So the solution that can be implement just in the HAML template is to capture contents of every block via capture_haml %div New
= form(model, "/posts", path_prefix: :comment) do |f|
- capture_haml do
= f.input :id
= f.textarea :body
= f.checkbox :public, value: true
= f.collection :replies do |reply|
- capture_haml do
= reply.input :content
= f.nested :owner do |owner|
- capture_haml do
= owner.input :name
= owner.input :email
= f.input :uuid
= f.submit value: "Submit" I don't know enough about internals for formular to say if this can be fixed internally, but I think this might be the right spot? |
I set it up (using the capture_haml approach above), but can't pull request to a non-existent branch on your repo - https://github.com/konung/gemgem-sinatra/tree/formular-haml-bootstrap4 Screenshot: https://user-images.githubusercontent.com/72493/46496670-417a4780-c7de-11e8-845c-5aaa9236be04.png |
Hi Fran.
Unless I'm missing something HAML support ( Haml 5.0.4 with corresponding cells-haml) is available out of the box ( I haven't tried hamlit). Just added a test & gemspec - based off of SLIM.
You did all the hard work! 👍