Am trying to remove the leading : from my YAML output. Here is the code and what I have done below:
model/attribution_channel.rb
DEFAULT_BONUS_CONFIG = {
sign_up: {
currency: 'ngn',
type: 'flat',
amount: 1000
},
visit: {
currency: 'ngn',
type: 'flat',
amount: 5
}
}
view/form.slim.html
AttributionChannel::DEFAULT_BONUS_CONFIG.to_yaml
The Output:
To remove the YAML Separator --- and the Leading : in the keys from my output, here is what I have done:
AttributionChannel::DEFAULT_BONUS_CONFIG.to_yaml.gsub("---\n", '').sub(":", '')
..but the .sub(":", '') part removed only the : of the first leading :.
How do I remove the leading : from my YAML output? Any help is appreciated? Here is what I want below:
sign_up:
currency: ngn
type: flat
amount: 1000
visit:
currency: ngn
type: flat
amount: 5
