I am trying to make a simple app, and on my index page, I am running into the error:
wrong number of arguments (2 for 1)
The view looks like so (index.html.slim):
- provide(:title, 'All users')
h1
| All users
ul.users
- @users.each do |user|
li
= gravatar_for user, size: 50
= link_to user.name, user
The error is pointing to the line:
= gravatar_for user, size: 50
Any idea why I am getting this error? Thank you in advance.
The options for gravatar_for should be in an options hash:
gravatar_for(user, options = { size: 50 }) ⇒ Object
See this .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.