ahmet
ahmet

Reputation: 5005

Sorting a date row in ruby

How do you sort by earliest date?

I tried .sort and I get

<td><%= effort.week_commencing.sort %></td>
// => undefined method `sort' for Mon, 12 Sep 2011:Date

The values are not in an array they are listed in a table.

Upvotes: 0

Views: 141

Answers (1)

Mahesh
Mahesh

Reputation: 6426

You can use the sort method only on array's. I don't think effort.week_commencing is returning an array in your case.

check what are you getting in effort.week_commencing.

Upvotes: 1

Related Questions