2

我正在尝试将此 gem https://github.com/richpeck/exception_handler添加到我的网站。

这是我的 config/application.rb

 config.exception_handler = {
            dev: true,
            db:     false, #-> defaults to :errors if true, else use :table_name
            email:  false, #-> need to integrate
            layouts: {
                '404' => 'application',
                '400' => 'application',
                '500' => 'application'
            },
    }

这是我的 app/views/exception_handler/exception/show.html.erb

<% provide(:title, 'Error') %>

<div class="jumbotronsignup nopadding">
  <div class="container nopadding">
    <div class="row">

        <% if /^(5[0-9]{2})$/ =~ @exception.status.to_s %>  

          <div class="col-md-4 col-md-offset-4 labelcolor padding2">

            <h3><%= "#{@exception.status} Error - #{details[:name]}" %></h3>
            <%= details[:description] %>
            <div class="thumbnail">
                        <strong>Our developers have been notified - we're working on it!</strong>
            </div>

           </div>

            <% else %>

          <div class="col-md-4 col-md-offset-4 labelcolor padding2">

            <div class="thumbnail">
                        <strong><%= content_tag :div, details[:description], class: "message" %></strong>
            </div>

           </div>

            <% end %>

    </div>

  </div>
</div>

我没有更改 app/controllers/exception_handler/exception_controller.rb 和 app/helpers/exception_handler/application_helper.rb 我不知道为什么显示背景图像。

如果我删除 app/assets/stylesheets/exception_handler/error.css.erb 的内容,那么图像就会消失,内容会按我的意愿显示。

我在哪里更改以获取该图像?

在此处输入图像描述

4

0 回答 0