Ask A Question

Notifications

You’re not receiving notifications from this thread.

Improving the URL Shortener Design Discussion

Hello Chris and ROR developers, Why I need to add **kwargs and what is doing ??

def favicon_image_tag(domain, **kwargs)
image_tag google_favicon_url(domain), **kwargs
end

Reply

Hey Diego, the **kwargs parameter is added to the method signature so that you can pass a hash of options to the favicon_image_tag method which will then be forwarded along to the image_tag method. This allows you to be able to pass different options (kwargs) wherever you call the favicon_image_tag method to customize attributes of the image_tag method. Hope that helps!

Reply

Thanks for taking the time to answer my question. I appreciate it.

Reply

No problem! I hope that clears it up for you, Diego!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,603+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.