FormFu / HTML-FormFu

HTML Form Creation, Rendering and Validation Framework. Just define the form, and let FormFu do the all heavy lifting.
http://formfu.rocks
34 stars 24 forks source link

- closing tag for error_container_tag missing #23

Closed Sadrak closed 9 years ago

Sadrak commented 10 years ago

using error_container_tag + tt won't work, because of a missing > at the closing tag

also i have a problem with using error_attributes. Changing in the same file error.attributes to self.error_attributes work, but then the behavior when a error_container_tag is set is broken. I don't get what is the problem there, but error_attributes and error_container_attributes won't work properly.

Example: error_attributes => { class => 'help-block', }, =>

<span>Error</span>

VS

error_container_tag => 'div', error_container_attributes => { class => 'test', }, error_attributes => { class => 'help-block', }, =>

<div class="help-block">
<span class="help-block">Error</span>
</div>
Sadrak commented 10 years ago

Hello,

i have now created failing tests for the problem with the error_attributes!

Perhaps i should have used t-aggregate/bugs as location for the new tests ... my fault.

OK, the big problem is: error_attributes is not respected! The compat-class from 'auto_error_class' are rendered in a special way and works by a fault is guess.

After 3 hours digging i can't find a good solution, so perhaps you can guide me.

Also there is a problem with the nested elements for this case.

I have modified _string_errors with two hints about this.

Have a nice day! Felix

djzort commented 9 years ago

i have just pushed changes for the first issue you have highlighted, which is "using error_container_tag + tt won't work, because of a missing > at the closing tag"

please create another PR for the other issue. just one issue per pull request please.