From 51fac11ae215f2fd2497c13e9d3d255f4b37c348 Mon Sep 17 00:00:00 2001 From: Gregory Moeck Date: Tue, 20 Apr 2010 05:28:24 +0800 Subject: [PATCH] add ajax helpers to be removed --- lib/application_checker.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/application_checker.rb b/lib/application_checker.rb index 76df796..c0e5e8b 100644 --- a/lib/application_checker.rb +++ b/lib/application_checker.rb @@ -236,6 +236,25 @@ module Rails end end + # Checks for old-style AJAX helpers + def check_old_ajax_helpers + files = [] + ['link_to_remote','form_remote_tag','remote_form_for'].each do |type| + lines = grep_for(type, "app/views/**/*") + inner_files = extract_filenames(lines) + files += inner_files unless inner_files.nil? + end + + if files + alert( + "Deprecated AJAX helper calls", + "AJAX javascript helpers have been switched to be unobtrusive and use :remote => true instead of having a seperate function to handle remote requests.", + "http://www.themodestrubyist.com/2010/02/24/rails-3-ujs-and-csrf-meta-tags/", + files + ) + end + end + # Checks for old cookie secret settings def check_old_cookie_secret lines = grep_for("ActionController::Base.cookie_verifier_secret = ", "config/**/*")