ActionView::TemplateError "changes was supposed to be a Hash, but was a String" #52

csommerauer opened this Issue Oct 12, 2010 · 1 comment


None yet
1 participant

This seems to happen after updating a timestamp. Below is the code in the template that creates the TemplateError

<% @model.versions.each do |version| %>
<%= version.changes['last_run'][1] %>

Database entry for "changes" causing the error
--- last_run: - !timestamp 20.10.2010 - !timestamp 14.10.2010

when escaping the the exclamation mark with a forward slash in the DB the error disappears.

The real error is actually
which pointed me in the right direction to solve this problem

This is actually a Rails Date.to_yaml issue if
is set to a Date format that YAML doesn't like. There is a workaround that worked for me at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment