I have a view with the flexigrid component on it. When the view calls the mickey_mouses_controller#new action, the flexigrid component calls mickey_mouses_controller#grid_data action (via localhost:3000/mickey_mouse/grid_data) and returns the relevant json objects correctly.
However, when I submit my view so the ActiveRecord validations fail and renders the view again (mickey_mouses_controller#create action), the flexigrid component is attempting to call the mickey_mouses_controller#grid_data action through localhost:3000/grid_data (instead of localhost:3000/mickey_mouses/grid_data) which is causing the following error.
No route matches "/grid_data" with {:method=>:post}
This is what I have in my routes.rb:
map.resources :mickey_mouse, :collection => {:grid_data => [:get, :post]}
Why is this happening and how can I fix it?
Appreciate any ideas to troubleshoot this and thanks in advance :)