Easily toggle alternate controllers and routes.
Things this peek view provides:
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install peek-alt-routes
Add the following to your config/initializers/peek.rb
:
Peek.into Peek::Views::AltRoutes
You may provide a name
option to the Peek view to set the button display text:
Peek.into Peek::Views::AltRoutes, name: 'Site Redesign'
Add the following to your app/assets/javascripts/application.js
:
//= require peek/views/alt_routes
Add the following to your app/assets/javascripts/application.css
:
/* *= require peek/views/alt_routes */
Use the peek_alt_routes?
route constraint as you see fit. In config/routes.rb
:
# Remember that Rails matches the first route it finds (top to bottom) so # be sure to put any constrained routes before the open routes. # Route group example: constraints peek_alt_routes?: true do get '/about', to: 'next_site#about' get '/contact', to: 'next_site#contact' end get '/about', to: 'site#about' get '/contact', to: 'site#contact' # Single case example: get 'new-site-only' to: 'new_site#only', constraints: { peek_alt_routes?: true } # DRY routes using routing concerns ( >= Rails 4.0 ) example: concern :static_pages do get '/about, action: 'about' get '/contact, action: 'contact' end scope controller: 'next_site', constraints: { peek_alt_routes?: true } do concerns :static_pages get '/help', action: 'help' end scope controller: 'site' do concerns :static_pages endWhen to use this vs Flipper
peek_alt_routes?
method is available in controllers as well should you need it.git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4