Skip to content

openstax/path_prefixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenStax Path Prefixer

Build Status

This gem lets all routes in your app be accessed with an optional path prefix. When the app is accessed with this prefix, redirects and url/path helpers will also use the prefix.

To use the gem, simply add it to your Gemfile:

git_source(:github) { |repo| "https://github.com/#{repo}.git" }
...
gem 'openstax_path_prefixer', github: 'openstax/keyword_search', ref: 'some_sha_here'

Then configure your app with the prefix you want (e.g. in your config/initializers/openstax_path_prefixer.rb):

OpenStax::PathPrefixer.configure do |config|
  config.prefix = "a_prefix"
end

This gem can also help to prefix assets. This has only been shown to work when assets are precompiled, e.g. in production, so a configuration like the following is recommended:

OpenStax::PathPrefixer.configure do |config|
  config.prefix_assets = Rails.env.production?
end

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •