aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb32
1 files changed, 6 insertions, 26 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ee0bd877e..5ecf8f57b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,12 +1,16 @@
# app/helpers/application_helper.rb:
-# Methods added to this helper will be available to all templates in the application.
+# Methods added to this helper will be available to all views (i.e. templates)
+# in the application.
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: application_helper.rb,v 1.11 2007-10-30 18:52:27 francis Exp $
+# $Id: application_helper.rb,v 1.12 2007-11-01 05:35:43 francis Exp $
module ApplicationHelper
+ # URL generating functions are needed by all controllers (for redirects)
+ # and views (for links), so include them into all of both.
+ include LinkToHelper
# Copied from error_messages_for in active_record_helper.rb
def foi_error_messages_for(*params)
@@ -38,30 +42,6 @@ module ApplicationHelper
def simple_date(date)
return date.strftime("%e %B %Y")
end
-
-
- # Links to various models
- # XXX consolidate with simplify_url_part in controllers/application.rb so
- # ones with calls to simplify_url_part are only in one place
-
- def request_link(info_request)
- link_to h(info_request.title), show_request_url(:id => info_request)
- end
-
- def public_body_link_short(public_body)
- link_to h(public_body.short_name), show_public_body_url(:simple_short_name => simplify_url_part(public_body.short_name))
- end
- def public_body_link(public_body)
- link_to h(public_body.name), show_public_body_url(:simple_short_name => simplify_url_part(public_body.short_name))
- end
-
- def user_link(user)
- link_to h(user.name), show_user_url(:simple_name => simplify_url_part(user.name))
- end
-
- def info_request_link(info_request)
- link_to h(info_request.title), show_request_url(:id => info_request)
- end
end