0

我正在获取卡片预览,但是当我发布推文时,我没有得到照片。无法弄清楚缺少什么。任何帮助都会很明显

应用程序.html

<% if content_for?(:head) %>
      <%= yield(:head) %>
<% end %>

索引.html

    <% @feeds.each_with_index do |feed,i| %>
            <div>
              <% content_for :head do %>

                <meta name="twitter:card" content="summary" />
                <meta name="twitter:title" content="<%= feed["title"] %>" />
                <meta name="twitter:description" content="<%= feed["description"] %>" />
                <meta name="twitter:image" content="<%= feed["image"].present? ? feed["image"] : feed["json_data"]["img"] %>" />
                <meta name="twitter:url" content="http://<%= select_url %>/entry/<%= feed["slug"]%>" />

                <meta property="og:url" content="http://<%= select_url %>/entry/<%= feed["slug"]%>" />
                <meta property="og:image" content="<%= feed["image"].present? ? feed["image"] : feed["json_data"]["img"] %>"  />
                <meta property="og:image:width" content="400" />
                <meta property="og:image:height" content="300" />
                <meta property="og:title" content="<%=  feed["title"] %>" />
              <% end %>
            </div>
<% end %>
<% end %>
4

0 回答 0