Skip to content

Commit

Permalink
Adding 'mount' property to Jasminerice module, so that applications c…
Browse files Browse the repository at this point in the history
…an control whether to automatically mount the Jasminerice engine in their application. Defaults to true. This is useful when the application including the engine wants to mount the engine itself in its own routes.rb, so that it can control the order it is mounted in (to mount it above a wildcard-matching route, for instance).
  • Loading branch information
stmontgomery committed Aug 26, 2012
1 parent ee46811 commit 7baedff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
root :to => "spec#index"
end

Rails.application.routes.draw do
mount Jasminerice::Engine => "/jasmine"
if Jasminerice.mount
Rails.application.routes.draw do
mount Jasminerice::Engine => "/jasmine"
end
end
2 changes: 2 additions & 0 deletions lib/jasminerice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
require 'haml'

module Jasminerice
mattr_accessor :mount
self.mount = true
end

0 comments on commit 7baedff

Please sign in to comment.