aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application.rb
diff options
context:
space:
mode:
authorfrancis <francis>2007-11-01 05:35:40 +0000
committerfrancis <francis>2007-11-01 05:35:40 +0000
commit5aeb7d884e40291b00e424b5df43e6abbd931051 (patch)
treeb44f349ac558c33e35806004a6584b1db99c6280 /app/controllers/application.rb
parent28fb182fa965467b73ad0b9bea506de8050305d3 (diff)
Make "rake spec:check" not check views or helpers, as I don't think
we need specialist test files for them (and even if I did they are screwed, as they can't call functions in controllers/views/routes from the test framework). Move various link to URL helpers into their own file, for ease of calling from views and controllers. Document Spec directory in top level README.
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r--app/controllers/application.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index d0d0fef7e..824f6f77b 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: application.rb,v 1.20 2007-10-31 17:25:29 francis Exp $
+# $Id: application.rb,v 1.21 2007-11-01 05:35:43 francis Exp $
class ApplicationController < ActionController::Base
@@ -73,17 +73,10 @@ class ApplicationController < ActionController::Base
end
end
- # Simplified links to our objects
- # XXX See controllers/user_controller.rb controllers/body_controller.rb for inverse
- # XXX consolidate somehow with stuff in helpers/application_helper.rb
- helper_method :simplify_url_part
- def simplify_url_part(text)
- text.downcase!
- text.gsub!(/ /, "-")
- text.gsub!(/[^a-z0-9_-]/, "")
- text
- end
-
+ # URL generating functions are needed by all controllers (for redirects)
+ # and views (for links), so include them into all of both.
+ include LinkToHelper
+
end