Posts

Showing posts from December 1, 2018

Rails: v-model VueJS attribute

Image
up vote 0 down vote favorite Inside a form tag i'm placing a hidden_field. This hidden_field should have a "v-model" attribute. I've tried all I can think about: # nothing shows up = f.hidden_field :model_attribute, "v-model" => "value" # that's the one I love the most: it compiles v="{:model=>"value"}" = f.hidden_field :model_attribute, v: { model: "value" } # it compiles with the underscore = f.hidden_field :model_attribute, v_model: "value" # this throws a compile error, obviously = f.hidden_field :model_attribute, v-model: "value" # guess the compiled outcome? = f.hidden_field :model_attribute, html: { "v-model" => "value" } #same as previous