polymer-rails
polymer-rails copied to clipboard
Form action attribute URL-escaping prevents data binding
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.
I found a workaround (at least I assume it's not the recommended method) by using annotated attribute binding:
form action$="{{url}}"
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?