Sha256: 5bb91eeee3bdecb05273f37fc1d1e0e36f54a527a6b3b60c9087ddca8605902f

Contents?: true

Size: 826 Bytes

Versions: 23

Compression:

Stored size: 826 Bytes

Contents

Rails.application.routes.draw do
  # For every standalone and verb registered by every component, add a route comp#family_component
  Components.constants.each do |family_cst|
    Components.const_get(family_cst).constants.each do |comp_cst|
      comp = Components.const_get(family_cst).const_get(comp_cst).new
      # Standalone configs are already grouped in a hash, one entry per name/path
      comp.standalone_configs.each_value do |standalone_config|
        next if standalone_config[:path].blank? # Ignore incomplete standalone configs (these come from parent classes )
        match(
          standalone_config.path,
          to:  "compony##{standalone_config.rails_action_name}",
          as:  standalone_config.path_helper_name,
          via: standalone_config.verbs.keys
        )
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
compony-0.5.1 config/routes.rb
compony-0.5.0 config/routes.rb
compony-0.4.1 config/routes.rb
compony-0.4.0 config/routes.rb
compony-0.3.3 config/routes.rb
compony-0.3.2 config/routes.rb
compony-0.3.1 config/routes.rb
compony-0.3.0 config/routes.rb
compony-0.2.3 config/routes.rb
compony-0.2.2 config/routes.rb
compony-0.2.1 config/routes.rb
compony-0.2.0 config/routes.rb
compony-0.1.1 config/routes.rb
compony-0.1.0 config/routes.rb
compony-0.0.9 config/routes.rb
compony-0.0.8 config/routes.rb
compony-0.0.7 config/routes.rb
compony-0.0.6 config/routes.rb
compony-0.0.5 config/routes.rb
compony-0.0.4 config/routes.rb