aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-02-13 16:58:33 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-02-15 12:22:22 +1100
commit4b83519e02d5d42708dd1770f965b122a11c4440 (patch)
treeb46311f4e9e8fbbbe1a3813f3bbcd4a0757cc5d8
parenta5e2adf08cdcea0bec25e14b83584091edfb79fb (diff)
Rename helper method
-rw-r--r--app/controllers/request_controller.rb2
-rw-r--r--app/controllers/track_controller.rb2
-rwxr-xr-xapp/helpers/link_to_helper.rb10
-rw-r--r--app/views/admin_public_body/show.rhtml2
-rw-r--r--app/views/contact_mailer/to_admin_message.rhtml2
-rw-r--r--app/views/public_body/_body_listing_single.rhtml4
-rw-r--r--app/views/request/new.rhtml2
7 files changed, 12 insertions, 12 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index dfa3a4834..0dec1fb72 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -279,7 +279,7 @@ class RequestController < ApplicationController
else
# if not requestable because defunct or not_apply, redirect to main page
# (which doesn't link to the /new/ URL)
- redirect_to public_body_url(@info_request.public_body)
+ redirect_to public_body_path(@info_request.public_body)
end
end
return
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index 15da7f327..df413b0ea 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -61,7 +61,7 @@ class TrackController < ApplicationController
return atom_feed_internal if params[:feed] == 'feed'
if self.track_set
- redirect_to public_body_url(@public_body)
+ redirect_to public_body_path(@public_body)
end
end
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 48423ff45..0c0128182 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -79,20 +79,20 @@ module LinkToHelper
end
# Public bodies
- def public_body_url(public_body)
+ def public_body_path(public_body)
public_body.url_name.nil? ? '' : show_public_body_url(:url_name => public_body.url_name, :only_path => true)
end
def public_body_link_short(public_body)
- link_to h(public_body.short_or_long_name), public_body_url(public_body)
+ link_to h(public_body.short_or_long_name), public_body_path(public_body)
end
def public_body_link(public_body, cls=nil)
- link_to h(public_body.name), public_body_url(public_body), :class => cls
+ link_to h(public_body.name), public_body_path(public_body), :class => cls
end
def public_body_link_absolute(public_body) # e.g. for in RSS
- link_to h(public_body.name), main_url(public_body_url(public_body))
+ link_to h(public_body.name), main_url(public_body_path(public_body))
end
def public_body_admin_url(public_body)
@@ -100,7 +100,7 @@ module LinkToHelper
end
def public_body_both_links(public_body)
- link_to(h(public_body.name), main_url(public_body_url(public_body))) + " (" + link_to("admin", public_body_admin_url(public_body)) + ")"
+ link_to(h(public_body.name), main_url(public_body_path(public_body))) + " (" + link_to("admin", public_body_admin_url(public_body)) + ")"
end
# Users
diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml
index cee306988..61ac668dd 100644
--- a/app/views/admin_public_body/show.rhtml
+++ b/app/views/admin_public_body/show.rhtml
@@ -35,7 +35,7 @@
<%=
# url_name can be missing if the name hasn't been set for this locale
if !@public_body.url_name.nil?
- link_to 'Public page', main_url(public_body_url(@public_body))
+ link_to 'Public page', main_url(public_body_path(@public_body))
else
'Public page not available'
end
diff --git a/app/views/contact_mailer/to_admin_message.rhtml b/app/views/contact_mailer/to_admin_message.rhtml
index 9c0a74c02..b41112c61 100644
--- a/app/views/contact_mailer/to_admin_message.rhtml
+++ b/app/views/contact_mailer/to_admin_message.rhtml
@@ -7,5 +7,5 @@
<%= _('Last request viewed: ')%><%= main_url(request_url(@last_request)) %>
<% end %> <% if !@last_body.nil? %>
-<%= _('Last authority viewed: ')%><%= main_url(public_body_url(@last_body)) %>
+<%= _('Last authority viewed: ')%><%= main_url(public_body_path(@last_body)) %>
<% end %>---------------------------------------------------------------------
diff --git a/app/views/public_body/_body_listing_single.rhtml b/app/views/public_body/_body_listing_single.rhtml
index b01d2ebb2..d0496fbb8 100644
--- a/app/views/public_body/_body_listing_single.rhtml
+++ b/app/views/public_body/_body_listing_single.rhtml
@@ -4,7 +4,7 @@
<div class="body_listing">
<span class="head">
- <%= link_to highlight_words(public_body.name, @highlight_words), public_body_url(public_body) %>
+ <%= link_to highlight_words(public_body.name, @highlight_words), public_body_path(public_body) %>
</span>
<span class="desc">
<% if !public_body.short_name.empty? || !public_body.notes_without_html.empty? %>
@@ -20,7 +20,7 @@
<span class="bottomline">
<%= n_('%d request made.', '%d requests made.', public_body.info_requests.size) % public_body.info_requests.size %>
<% if !@include_request_link_in_authority_listing.nil? %>
- <%= link_to _("Make your own request"), public_body_url(public_body) %>.
+ <%= link_to _("Make your own request"), public_body_path(public_body) %>.
<% end %>
<br>
<span class="date_added">
diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml
index f396ea9ec..3c9d0057d 100644
--- a/app/views/request/new.rhtml
+++ b/app/views/request/new.rhtml
@@ -41,7 +41,7 @@
<span id="to_public_body"><%=h(@info_request.public_body.name)%></span>
<div class="form_item_note">
<% if @info_request.public_body.info_requests.size > 0 %>
- <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_path(@info_request.public_body)) %>
<% else %>
<%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %>
<% end %>