diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/public_body.rb | 10 | ||||
-rw-r--r-- | app/views/public_body/show.html.erb | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index c023b436c..b9519c1aa 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -347,7 +347,7 @@ class PublicBody < ActiveRecord::Base # Use tags to describe what type of thing this is - def type_of_authority(html = false) + def type_of_authority types = tags.each_with_index.map do |tag, index| if PublicBodyCategory.get().by_tag().include?(tag.name) desc = PublicBodyCategory.get().singular_by_tag()[tag.name] @@ -355,12 +355,8 @@ class PublicBody < ActiveRecord::Base if index.zero? desc = desc.sub(/\S/) { |m| Unicode.upcase(m) } end - - if html - # TODO: this should call proper route helpers, but is in model sigh - desc = '<a href="/body/list/' + tag.name + '">' + desc + '</a>' - end - + # TODO: this should call proper route helpers, but is in model sigh + desc = '<a href="/body/list/' + tag.name + '">' + desc + '</a>' desc end end diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb index e7c5fa2b6..bce396cd8 100644 --- a/app/views/public_body/show.html.erb +++ b/app/views/public_body/show.html.erb @@ -32,7 +32,7 @@ <h1><%=h(@public_body.name)%></h1> <p class="subtitle"> - <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>, + <%= @public_body.type_of_authority %><% if not @public_body.short_name.empty? %>, <%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %> <% if !@user.nil? && @user.admin_page_links? %> (<%= link_to _("admin"), admin_body_path(@public_body) %>) |