Method: Solidus::InstallGenerator#install_routes

Defined in:
lib/generators/solidus/install/install_generator.rb

#install_routesObject



137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/generators/solidus/install/install_generator.rb', line 137

def install_routes
  if Pathname(app_path).join('config', 'routes.rb').read.include? CORE_MOUNT_ROUTE
    say_status :route_exist, CORE_MOUNT_ROUTE, :blue
  else
    route <<~RUBY
      # This line mounts Solidus's routes at the root of your application.
      # This means, any requests to URLs such as /products, will go to Spree::ProductsController.
      # If you would like to change where this engine is mounted, simply change the :at option to something different.
      #
      # We ask that you don't use the :as option here, as Solidus relies on it being the default of "spree"
      #{CORE_MOUNT_ROUTE}, at: '/'
    RUBY
  end
end