I ' m not used to the syntax of your HTML but I think the problem is that you ' re not using brackets after myFunction . It should be myFunction next to onclick , half way down your code . This is not ajax , though . It ' s just regular Javascript . Where are you calling a controller method ? Also , have you included pagejavascript somewhere in your layout ? Otherwise that whole block wouldn ' t be rendered on the page you can check via your browser to ensure it ' s there at the bottom . edit it ' s probably a scoping thing unique to Coffeescript actually see other person ' s answer on StackOverflow . <| sep |> WIC is food stamps . And I mean we explicitly pay some farmers to grow nothing . <| sep |> He said he hadnt played it in 20 years and then struggled to remember the power chords lol .