Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

time_ago_in_words reports incorrect number of args, when correct # args used

#5398

Rails is reporting an argument error when there isn't one:

 ArgumentError in Feed_entries#index

Showing /Users/Caroline/Sites/test_tree/app/views/feed_entries/index.html.erb where line #10 raised:

wrong number of arguments (3 for 1)

Extracted source (around line #10):

7:     <p><%= truncate(entry.summary, :length => 300, :omission =>"…") %></p>
8:     <% if entry.published_at %>
9:       <p>
10:         <%= time_ago_in_words(entry.published_at) %> 
11:       </p>
12:     <% end %>
13:     <hr>

Rails.root: /Users/Caroline/Sites/test_tree
Application Trace | Framework Trace | Full Trace

app/helpers/application_helper.rb:18:in `distance_of_time_in_words'
app/views/feed_entries/index.html.erb:10:in `block (2 levels) in

It appears to stem from distance_of_time_in_words, as this gives the same error when passed the 3 args it should accept.

Reported by MattB · August 18th, 2010 @ 01:05 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Andrea Campi
    Andrea Campi

    I cannot reproduce this, can you provide a diff demonstrating the issue or at least confirm it's still failing for you?

    October 18th, 2010 @ 06:43 AM

  2. Aditya Sanghi
    Aditya Sanghi
    • Importance changed from to Low

    MattB,

    Have you overridden some methods in your application_helper.rb? Sharing that would help determine the problem. A part of the stack trace you've pasted shows "app/helpers/application_helper.rb:18:in distance_of_time_in_words'".

    October 18th, 2010 @ 12:19 PM

  3. Aditya Sanghi
    Aditya Sanghi
    • State changed from new to invalid

    Marking invalid until Matt, provides input. I was also not able to reproduce the problem.

    October 20th, 2010 @ 09:31 AM