Reputation: 1276
i'm in section 9 of the hartl rails tutorial, this def isn't making sense. thoughts?
1) User pages index
Failure/Error: visit users_path
ActionView::Template::Error:
wrong number of arguments (2 for 1)
# ./app/helpers/users_helper.rb:3:in `gravatar_for'
# ./app/views/users/index.html.erb:7:in `block in _app_views_users_index_html_erb__3004047397113020476_70255017945740'
# ./app/views/users/index.html.erb:5:in `each'
# ./app/views/users/index.html.erb:5:in `_app_views_users_index_html_erb__3004047397113020476_70255017945740'
# ./spec/requests/user_pages_spec.rb:12:in `block (3 levels) in <top (required)>'
2) User pages index should list each user
Failure/Error: visit users_path
ActionView::Template::Error:
wrong number of arguments (2 for 1)
# ./app/helpers/users_helper.rb:3:in `gravatar_for'
# ./app/views/users/index.html.erb:7:in `block in _app_views_users_index_html_erb__3004047397113020476_70255017945740'
# ./app/views/users/index.html.erb:5:in `each'
# ./app/views/users/index.html.erb:5:in `_app_views_users_index_html_erb__3004047397113020476_70255017945740'
# ./spec/requests/user_pages_spec.rb:12:in `block (3 levels) in <top (required)>'
Upvotes: 3
Views: 1606
Reputation: 1893
In Your user_helper.rb file in helper folder you are passing 2 arguments instead of 1 for gravatar_for method. If you put code of that it would be much easier to solve.
Upvotes: 1
Reputation: 3219
Chapter 7's first exercise specifies that you extend the gravatar_for
method to include a new, optional parameter for including size. You likely didn't do this exercise and so it is only expecting the original 1 argument as opposed to both arguments. Complete the exercise and you should get this code to pass.
Upvotes: 12