Ajax routes in Rails 3
- by Jatin
In my Rails 2.3 application, the following routes were working properly
map.ajax 'ajax', :controller => 'widgetresponse_controller' , :action => 'getWidgetJson'
When I migrated to Rails 3,
I tried a number of new routes, to get this working but none of them worked.
1.
match 'ajax' => 'widgetresponse#getWidgetJson', :as => :ajax
2.
match 'ajax' => 'widgetresponse_controller#getWidgetJson', :as => :ajax
3.
get 'widgetresponse/getWidgetJson', :as => :ajax
4.
get 'widgetresponse/getWidgetJson'
Its a very basic question to ask, but I don't know what I am doing wrong.