AJAX · JQuery · Ruby On Rails

Making a ajax request from rails

Making a AJAX request in rails is pretty simple. Just follow the below example. It will take you to the particular¬† method (ex.., todo_fix method in the rooms controller) as used in my example. Then in controller you can perform your operation and do the render part. In View File Sample Rails code <% todo_item=TodoItem.find(:first)… Continue reading Making a ajax request from rails

Rails 3 · ruby

Routing in Rails 3

Root Route root :to => ‘welcome#show’. Named Route match ‘logout’, :to => ‘sessions#destroy’ RESTful Routes resources :products Nested Resources resources :projects do resources :tasks, :people end Namespaced Resources namespace :admin do resources :projects end Some example : match “/about(.:format)” => “info#about”, :as => :about match “/:year(/:month(/:day))” => “info#about”, :constraints => { :year => /\d{4}/, :month… Continue reading Routing in Rails 3