polymer-rails icon indicating copy to clipboard operation
polymer-rails copied to clipboard

Form action attribute URL-escaping prevents data binding

Open Odaeus opened this issue 9 years ago • 2 comments

Not sure if I'm doing this wrong but I have the following in a component HTML (written in Slim):

dom-module is="blah"
  template
    form action="{{url}}"
      input name="test" type="text"

This outputs:

<dom-module id="blah">
  <template>
    <form action="%5B%5Burl%5D%5D" method="get">
      <input type="text" name="test" />
    </form>
  </template>

Which means the action attribute cannot be bound due to URL escaping. Using data binding braces on other attributes works as normal, it's only affecting the form action attribute. I suspect this is caused by Nokogiri but I haven't been able to find the source of the problem.

Odaeus avatar Feb 09 '16 22:02 Odaeus

I found a workaround (at least I assume it's not the recommended method) by using annotated attribute binding:

  form action$="{{url}}"

Odaeus avatar Feb 10 '16 00:02 Odaeus

I found a similar problem with paper-icon-button - Nokogiri escaping "[[src]]". I posted a patch here: https://github.com/alchapone/polymer-elements-rails/issues/9

@alchapone - is there a better way to patch?

agnewtj avatar Feb 13 '16 16:02 agnewtj