route / errgent Goto Github PK
View Code? Open in Web Editor NEWError pages generator
License: MIT License
Error pages generator
License: MIT License
Do not generates digests for asset paths
<link rel="stylesheet" media="all" href="/assets/application.css">
instead
<link rel="stylesheet" media="all" href="/assets/application-9a249aeeaa09274a1980dd021fa84fd09d2e5d03e110b45f320737bafe17622d.css">
I need inject some methods to ActionView, such as signed_in?
.
I see some helpers injections at https://github.com/route/errgent/blob/master/lib/errgent/renderer.rb#L8-L9
How i can inject my helper-files and some other dummy-helpers?
desc 'Generate error pages'
task errgent: :environment do
renderer = Errgent::Renderer.new(
codes: [404], # error codes by default, @code variable is available in layout
# vars: { name: 'value' }, # variable @name will be available in layout
# layout: 'layouts/error_page', # where to find your layout by default
# output: 'public/%s.html' # where to put generated pages by default, %s is the replacement for @code
)
# You can override or define new helpers:
renderer.helpers do
def user_signed_in?
false
end
end
renderer.render
end
be rake errgent
rake aborted!
ActionView::Template::Error: undefined method `user_signed_in?' for #<ActionView::Base:0x007fda24184790>
How to use route helpers such as root_path?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.