Pginas dinmicas de erro em Rails com Goalie
Helder Ribeiro
public/400.htmlpublic/500.htmlpublic/400.pt-BR.htmlpublic/500.pt-BR.html
Contedo dinmico?
$ gem install goalie
# config/application.rbrequire 'goalie/rails'
Seus problemas se acabaram!
# goalie/rails
module Goalie class Engine < Rails::Engine
initializer "goalie.add_middleware" do |app| app.middleware.delete 'ShowExceptions' app.middleware.use Goalie::CustomErrorPages end
endend
app/views/public_errors/forbidden.html.erbapp/views/public_errors/not_found.html.erbapp/views/local_errors/
class PublicErrorsController < ApplicationControllerend
class PublicErrorsController < ApplicationController # 404 def not_found @posts = Post.find_latest endend
github.com/obvio171/goalie(MIT license)
@obvio171
Top Related