We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In my instance I had issues parsing the meta attributes in edit page.
undefined method `each' for "{}":String
I fixed that by using:
diff --git a/app/views/shared/_meta_form.html.haml b/app/views/shared/_meta_form.html.haml index 00d8c0c..7c7847f 100644 --- a/app/views/shared/_meta_form.html.haml +++ b/app/views/shared/_meta_form.html.haml @@ -1,5 +1,15 @@ +- require 'json' #js-meta-table.invoice-table - - instance.meta.each do |key, value| + - meta_data = {} + - if instance.meta.is_a?(String) && !instance.meta.empty? + - begin + - # Convert Ruby hash string to valid JSON format + - valid_json = instance.meta.gsub("=>", ":").gsub(/(['"])(.*?)\1/, '"\2"') + - meta_data = JSON.parse(valid_json) rescue {} + - rescue JSON::ParserError => e + %p Error parsing JSON: #{e.message} + + - meta_data.each do |key, value| .invoice-row.js-meta .invoice-col.form-group = text_field :key, "", value: key, class: 'form-control', placeholder: "Key"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In my instance I had issues parsing the meta attributes in edit page.
I fixed that by using:
The text was updated successfully, but these errors were encountered: