I am trying to add a route to a controller that has been set as a resource开发者_Python百科 in the 'admin' namespace like this:
namespace :admin do
  resources :books do
    collection do
      post :process_new
    end
  end
end
I have added an action int the Admin::BooksController for process_new, but whenever I try to access this action using the url: .../admin/books/process_new I get the following error:
Couldn't find Book with ID=process_new
It looks like it's routing to the show action and trying to use process_new as the id. Can someone shed some light on what I may be doing wrong?
**Edit: I changed my redirects to use the helper functions and it seems to be working.
Add get :process_new to your resources :books routes:
namespace :admin do
  resources :books do
    collection do
      get :process_new
      post :process_new
    end
  end
end
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论