Ruby on Rails: Some buttons are showing as “Create {{model}}”
Recently I worked on a Ruby on Rails project where I had to alter previous agency’s code rather than start from scratch, which is both a blessing and ball-ache, but mainly a time-consuming ball-ache.
One of the problems I came across is that several buttons displayed “Create {{model}}” or “Add {{model}}” rather than just “Create” or “Add”.
After searching and finding nothing, I resorted to asking a question on stackoverflow.
It turns out, the curly brackets are caused by the locales file (language file) not containing entries for English language of the buttons.
The buttons were generated using a gem called “formtastic” so I was able to resolve the issue by adding the following lines to the localisation-file (config/locales/en.yml)
en:
formtastic:
yes: 'Yes'
no: 'No'
create: 'Create'
save: 'Save'
submit: 'Submit'
required: 'Required'