Sha256: 7af41240b986d79ad00e1fecd155101cf87f00c2e19ba78e55c2e6760a2bd6f5
Contents?: true
Size: 746 Bytes
Versions: 3
Compression:
Stored size: 746 Bytes
Contents
# frozen_string_literal: true # NOTE: Not strictly required, but it helps to simplify the setup. class JsFromRoutes::Railtie < Rails::Railtie railtie_name :js_from_routes if Rails.env.development? # Allows to automatically trigger code generation after updating routes. initializer 'js_from_routes.reloader' do |app| app.config.to_prepare do JsFromRoutes.generate!(app) end end end # Suitable when triggering code generation manually. rake_tasks do |app| namespace :js_from_routes do desc 'Generates JavaScript files from Rails routes, one file per controller, and one function per route.' task generate: :environment do JsFromRoutes.generate!(app) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
js_from_routes-1.0.2 | lib/js_from_routes/railtie.rb |
js_from_routes-1.0.1 | lib/js_from_routes/railtie.rb |
js_from_routes-1.0.0 | lib/js_from_routes/railtie.rb |