Methods

Files

Class Index [+]

Quicksearch

Ubiquo::Extensions::Routing

Public Instance Methods

from_plugin(name, options = {}) click to toggle source

Loads the set of routes from within a plugin and evaluates them at this point within an application’s main routes.rb file.

Plugin routes are loaded from <plugin_root>/routes.rb.

    # File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/routing.rb, line 8
 8:       def from_plugin(name, options = {})
 9:         # At the point in which routing is loaded, we cannot guarantee that all
10:         # plugins are in Rails.plugins, so instead we need to use find_plugin_path
11:         self.with_options(options) do |map|
12:           routes_path = Rails.root.join('vendor', 'plugins', name.to_s, 'config', 'plugin_routes.rb')
13:           # logger.debug "loading routes from #{routes_path}"
14:           eval(IO.read(routes_path), binding, routes_path) if File.file?(routes_path)
15:         end
16:       end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.