我的 /views/layouts/ 文件夹中有一个侧边栏文件,其中有一个可在 /assets/images/ 访问的标题图像但是,当我转到localhost:3000/books/new
侧边栏时,标题图像无法显示。查看终端,它正在 /books/assets/images/ 中寻找标题图像
有没有办法快速修复此错误而无需将我的图像复制到新文件夹中?
__sidebar.html.haml
%img#menu-image{src: "assets/books.png"}
.pure-menu.pure-menu-open#menu-bottom.button-color
%ul
%li
=link_to 'Home', root_path
%li
=link_to 'About', about_path
%li
=link_to 'Find Textbooks', search_path
%li
=link_to 'List your Textbooks', new_book_path
应用程序.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Bookweb</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
<%= favicon_link_tag 'favicon.ico' %>
</head>
<body>
<div class="pure-g-r" id="main-pad">
<div class="pure-u" id="menu">
<%= render 'layouts/sidebar' %>
</div>
<div class="pure-u-1" id="main">
<%= yield %>
</div>
</div>
</body>
</html>