Hi I am new to Ruby and Json. Need help with this command being used in
Ruby, for parsing Json files.
I get the following error,
no implicit conversion of Symbol into String (TypeError)
This is how its being used,
def get_language_text(language, type, text)
if language.downcase == "french" format :json fr_file = File.read("/config/data/api/admin/labels_FR.json") fr_file_parsed = parse_file(fr_file) @text_fr = fr_file_parsed[type][text] end @text_fr
require ‘json’ is already included in another environment config file.
if I don’t use the format :json, I get the following error,
undefined method `’ for nil:NilClass (NoMethodError)
Appreciate the help. Thanks, Joel