Report abuse

tasks/hello.js.erb

page.alert "hello world"

routes.rb

ActionController::Routing::Routes.draw do |map|
  map.root :controller => "tasks"
  map.resources :tasks, :collection => {:list => :get, :hello => :get}

tasks/list.html.erb

Tasks

<%= link_to_remote "say hello", :url => formatted_hello_tasks_path(:js), :html => {:method => :get} %>