Form helper - syntax change

Hi,

I was going to ruse some of my code from one of the 1.3 apps and in my 2.3 app and the form block style is apparently not supported anymore. This, for example returns undefined method div:

div class: "my-class" do

end

Will this be supported in the future again?

This looks a lot like Phlex. While there isn’t an official way to integrate Phlex with Hanami views at the moment, few people (including me) were interested in this. So I think we will get there eventually.

It was supported in 1.3, it’s still in the docs: V1.3: Forms | Hanami Guides.

Also, the select is behaving strange as well. I have this code:

<div class: "form-field2">
  <%= f.label "Active?", for: :active %>
  <%= f.select :active, active_switch, options: {selected: company.active}, class: "form-input" %>
</div>

And the value doesn’t get selected (worked in 1.3), there’s no code error output and the generated html is:

<div class: "form-field2">
  <label for="company-active">Active?</label> <select name="company[active]" id="company-active" class="form-input"><option>0</option><option>1</option></select>
</div>

Yes, it was Hanami::Helpers if I’m not mistaken, but it has been discontinued. However, looking at new Hanami::View, I found TagHelper, so perhaps this would work?

tag.div class: "my-class" do

end

Ah, yes. That works. Thank you!