richpeck/exception_handler

View on GitHub
app/views/layouts/exception.html.erb

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
  <!-- Head -->
  <head>
    <!-- Info -->
    <%= content_tag :title, "Error - #{@exception.status} (#{@exception.response.to_s.gsub("_", " ").titleize})" %>

    <!-- Styling -->
    <%= stylesheet_link_tag :exception_handler %>
    <%= favicon_link_tag "exception_handler/favicon.ico" %>

    <% if x = ExceptionHandler.config.options(@exception.status) %>
      <style>body { background: url("<%= asset_path x %>") center center no-repeat !important; background-size: cover !important; }</style>
    <% end %>

    <!-- Auth -->
    <%= csrf_meta_tags %>
  </head>

  <!-- Body -->
  <%= content_tag :body, yield %>

  <!-- Footer -->
  <% if ExceptionHandler.config.try(:social) %>
    <%= content_tag :footer do %>
      <% ExceptionHandler.config.social.each do |k,v| %>
        <%= link_to image_tag("exception_handler/connect/#{k}.png"), ExceptionHandler::Config::SOCIAL[k] + "/" + v, id: k, title: "#{k.to_s.titleize} Feed", target: :blank if v %>
      <% end %>
    <% end %>
  <% end %>

</html>