Adding Routes to Rails' Spree E-Commerce

前端 未结 3 1222
别跟我提以往
别跟我提以往 2020-12-05 15:33

I just recently upgraded to 1.0.3, and the routes.rb file in my config/routes folder seems to ignore all my custom routes.

MY routes.rb

         


        
相关标签:
3条回答
  • 2020-12-05 16:00

    I encountered the same error and found this solution, which solved it by prefixing main_app, before each of my_paths/_urls. In my case, these were links used in one of the /override.rb files.

    So, try: main_app.about_us_path.

    0 讨论(0)
  • 2020-12-05 16:03

    For me prepend did not work. for me draw did the work:

    Spree::Core::Engine.routes.draw do
       resources :orders, except: [:new, :create, :destroy] do
          post :my_order, on: :collection
       end
    end
    
    0 讨论(0)
  • 2020-12-05 16:07

    You can add new routes in the Spree using following block in routes.rb file

    Spree::Core::Engine.routes.prepend do
      # Your new routes
    end
    
    0 讨论(0)
提交回复
热议问题