Can anyone see why this is failing? It’s probably something dumb on my
part but i’m stumped
ActionView::TemplateError (interpolation argument :date_string missing
in “Created on {{:date_string}} at {{:time_string}}”) on line #51 of
app/views/quizzes/edit_step_0.html.haml:
48: %p
49: = quiz.name
50: %br/
51: = t(‘general.created_on’, :date_string =>
quiz.created_at.strftime(’%d/%m/%y’), :time_string =>
quiz.created_at.strftime(’%H:%M’))
52: = link_to “Edit”, edit_quiz_path(quiz), :title => “Edit
quiz”, :class => “Button”
53:
As far as i can see this error doesn’t make sense as i’m passing
date_string through in my t call. Here’s the t call line by itself:
= t('general.created_on', :date_string =>
quiz.created_at.strftime(’%d/%m/%y’), :time_string =>
quiz.created_at.strftime(’%H:%M’))
here’s my en.yml file, with some lines removed for clarity:
en:
hello_world: Hello
general:
created_on: “Created on {{:date_string}} at {{:time_string}}”
It’s nothing to do with the actual values i’m passing through, ie all
the created_at.strftime stuff. If i swap those out for ‘foo’ and ‘bar’
i get the same problem. Can anyone see what i’m doing wrong?
thanks, max