Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 从我的应用程序/资产/图像向我的rails应用程序添加徽标_Html_Ruby On Rails_Ruby_Erb_Tailwind Css - Fatal编程技术网

Html 从我的应用程序/资产/图像向我的rails应用程序添加徽标

Html 从我的应用程序/资产/图像向我的rails应用程序添加徽标,html,ruby-on-rails,ruby,erb,tailwind-css,Html,Ruby On Rails,Ruby,Erb,Tailwind Css,我正在使用rails和tailwind css开发我的intagram克隆应用程序。我已经设法创建了一个导航栏,我试图在“导航栏”的左侧添加一个徽标,但当我在本地运行它时,图像没有加载 my navbae.html.erb: <nav class="flex justify-between items-center"> <a href=<%= root_path %>> <%= image_tag "/images/

我正在使用rails和tailwind css开发我的intagram克隆应用程序。我已经设法创建了一个导航栏,我试图在“导航栏”的左侧添加一个徽标,但当我在本地运行它时,图像没有加载

my navbae.html.erb:

<nav class="flex justify-between items-center">
  <a href=<%= root_path %>>
  <%= image_tag "/images/logo.png" %>
  </a>  
  <div>
    <% if user_signed_in?%>
        <a><%= link_to"Home", root_path, class: "text-lg no-underline text-grey-darkest hover:text-blue-dark ml-2"%> <i class="fas fa-home"></i></a>
        <a><%= link_to"My profile", profile_path(current_user.username), class: "text-lg no-underline text-grey-darkest hover:text-blue-dark ml-2"%> <i class="far fa-user"></i> </a>
        <a><%= link_to"New Post",new_post_path, class: "text-lg no-underline text-grey-darkest hover:text-blue-dark ml-2"%> <i class="fas fa-plus-square"></i></a>
        <a><%= link_to "log out", destroy_user_session_path,method: :delete, class: "text-lg no-underline text-grey-darkest hover:text-blue-dark ml-2" %> <i class="fas fa-sign-out-alt"></i></a>
        <%else%>
    <a><%= link_to "sign up", new_user_registration_path,class: "text-lg no-underline text-grey-darkest hover:text-blue-dark ml-2" %> <i class="fas fa-user-plus"></i></a>
    <a><%= link_to "sign in", new_user_session_path,class: "text-lg no-underline text-grey-darkest hover:text-blue-dark ml-2" %><i class="fas fa-sign-in-alt"></i></a>
  <%end%>
  </div>
</nav>

如果您的徽标位于此路径
app/assets/images/logo.png
,您可能应该这样做

<%= image_tag 'logo.png' %>