Hommer Smith
Hommer Smith

Reputation: 27852

Full assets path in application.html.erb layout

I am trying to use the open graph meta tags to do something like this:

  <meta name="og:image" content="/assets/icon.png">

But it seems is not loading the image. How should I access the full path of the assets, or what am I doing wrong?

Thanks

Upvotes: 0

Views: 1228

Answers (1)

pdoherty926
pdoherty926

Reputation: 10379

Are you using the Asset Pipeline?

If so:

<meta name="og:image" content="<%= asset_path('icon.png') %>">

Upvotes: 1

Related Questions