title: Can't map a range of dates in Ruby/Rails
body: <p>I'm trying to map a range of dates and pass them to my view as an array, as follows:</p>
  
  <pre><code>from, to = Date.parse("2014-01-01"), Date.yesterday
  date_range = (from..to)
  
  @mapped_dates = date_range.map {|date| date.strftime("%b %e")}
  </code></pre>
  
  <p>I reference them in some JS in my view as follows:</p>
  
  <pre><code>dateLabels = &lt;%= raw @mapped_dates.to_json %&gt;;
  </code></pre>
  
  <p>When I visit the page, I get the following error:</p>
  
  <pre><code>can't iterate from ActiveSupport::TimeWithZone
  </code></pre>
  
  <p>The strange thing is, I can run the Ruby in the Rails console, and it returns what I expect: <code>["Jan 1", "Jan 2", "Jan 3", ... ]</code></p>
  
  <p>Does anyone have an idea what might be causing this error?</p>