Ajax routes in Rails 3

Posted by Jatin on Stack Overflow See other posts from Stack Overflow or by Jatin
Published on 2011-01-12T17:50:57Z Indexed on 2011/01/12 17:54 UTC
Read the original article Hit count: 257

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.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails3