ruby-on-railsrubyruby-on-rails-4ruby-2.1jammit

Rails 4 and Jammit routing issue - should not use match


I've upgraded to Rails 4.0.5 and i'm using Jammit 0.6.6. When starting the server i get an error :

/home/haimh/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.5/lib/action dispatch/routing/mapper.rb:191:in normalize_condition!:You should not use the match method in your router without specifying an HTTP method.

Looking at the stack trace i see that Jammit's routes.rb file is using the old routing API.

Is there any way of resolving this issue, beside updating the code manually in Jammit's routes.rb file?


Solution

  • use the via

    like this:

    adding , via => [:get, :post] to the end

    match ':controller(/:action(/:id))' , :controller=> /admin\/[^\/]+/, :via => [:get,:post]
    

    if you dont want to use match , you will have to have your routes inside the

    resources :controller do
     get :action, :on => :collection
    end