app/components/lookbook/params/field/component.rb in lookbook-1.4.4 vs app/components/lookbook/params/field/component.rb in lookbook-1.4.5
- old
+ new
@@ -12,14 +12,14 @@
def before_render
styles, html = StylesExtractor.call(render_input)
Editor::Component.add_styles(param.input, styles)
- escaped_value = json_escape(param.value.to_json)
+ escaped_value = json_escape(param.value.to_s)
wrapper_attrs = {
data: {"param-input": param.input},
- "x-data": "paramsInputComponent({name: '#{param.name}', value: #{escaped_value}})"
+ "x-data": "paramsInputComponent({name: '#{param.name}', value: '#{escaped_value}'})"
}
@rendered_input = tag.div(**wrapper_attrs) { html.html_safe }
end
protected
@@ -29,10 +29,10 @@
input_options[:id] = "param-#{param.name}"
render(param.input_partial,
name: param.name,
input: param.input,
- value: param.value,
+ value: param.value.to_s,
value_type: param.value_type,
value_default: param.value_default,
input_options: input_options.except(:choices, :opts),
choices: input_options[:choices])
end