Ok so I''m wanting to make the ajax controller methods more obvious in
my code.
Option one is to affix "_ajax" to the end of the method name, but that
just isn''t sexy enough.
Option two is to include a "# AJAX methods" comment above the methods,
but again, just not sexy enough.
How about we declare an ''ajax'' scope in our controller
classes... so
instead of:
def MyAjaxianController < ApplicationController
def index
...
end
def something_else
...
end
def another_something_ajax
...
end
private
def a_private_method
...
end
end
... we sprinkle some of that Matz magic, and get:
def MySexyAjaxianController < ApplicationController
def index
...
end
def something_else
...
end
ajax
def another_something
...
end
private
def a_private_method
...
end
end
Maybe it could even do a before_filter to check for request.xhr on the
AJAX methods...
thoughts?
- tim lucas