0

我的application.html.erb. 它在我的根视图中正确显示,但是当我移动到login该图像时消失。我正在谈论的图像是 ChainLogo.png。任何想法我做错了什么?

我现在的根布局如下所示:

<%= stylesheet_link_tag "home", :media => "all" %>
<div id="home_log_in">
    <%= link_to 'Log-in', login_index_path %>
</div>

我的 application.html.erb 看起来像这样:

<!DOCTYPE html>
<html>
<head>
  <title>Chain</title>
  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
  <%= csrf_meta_tags %>
</head>
<body>

<%= yield %>
    <div id="main_banner"> </div>
    <div id="main_logo"><img src="assets/images/ChainLogo.png"></div> 

</body>
</html>

我的 login.html.erb 看起来像这样:

<%= stylesheet_link_tag "login", :media => "all" %>

<div id="signin_form">  
    <%=form_for :user  do |f| %>

        <%= f.text_field :email, :id => "email_input", :placeholder => "enter email" %>             
    <div id="signmeup_button">
        <%= f.text_field :password, :id => '"password', :placeholder => "enter password"%>
    </div>

    <div id="just_email_signup">
        <%= f.submit %> 

    <% end %>
    </div>

</div>
4

1 回答 1

1

取而代之的是,<img src="assets/images/ChainLogo.png">请使用 rails 标记将图像附加<%= image_tag "ChainLogo.png" %>到您的 application.html.erb 文件中。

于 2013-09-06T07:22:05.343 回答