Sha256: 86219bb1a139871cb9fcd419d0cee62824de5b793d3cb783a46ec886d369ee9b
Contents?: true
Size: 949 Bytes
Versions: 1
Compression:
Stored size: 949 Bytes
Contents
require 'front_end_builds/routing_constraints/html_routing_constraint' module ActionDispatch::Routing class Mapper # Create a front end in your rails router. def front_end(name, path = name, options = {}) # Generic routes that have nothing to do with the app # name. Use this for testing or providing a non # app api endpoint. namespace :front_end_builds do resources :builds, only: [:index, :create] end # Create a new build for this app. post( "#{path}" => "front_end_builds/builds#create", defaults: { app_name: name } ) # Get a build for this app. constraints FrontEndBuilds::HtmlRoutingConstraint.new do get( "/#{path}/(*path)" => "front_end_builds/builds#index", defaults: { branch: 'master', app_name: name }.merge(options) ) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
front_end_builds-0.0.6 | lib/front_end_builds/ext/routes.rb |