diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 32e625d..bffd995 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -148,14 +148,8 @@ module ApplicationHelper
link_to text, profile_path(:profile => profile) , options
end
- def link_to_homepage(text, profile = nil, options = {})
- p = if profile
- Profile[profile]
- else
- user
- end
-
- link_to text, p.url, options
+ def link_to_homepage(text, profile, options = {})
+ link_to text, profile.url, options
end
def link_if_permitted(link, permission = nil, target = nil)
diff --git a/app/views/account/index.html.erb b/app/views/account/index.html.erb
index e8ed9d2..b7413b7 100644
--- a/app/views/account/index.html.erb
+++ b/app/views/account/index.html.erb
@@ -11,7 +11,7 @@
-<%= link_to_homepage(_('My home page.')) %>
+<%= link_to_homepage(_('My home page.'), user) %>
<%= _('See your homepage.') %>
diff --git a/app/views/region_validators/region.html.erb b/app/views/region_validators/region.html.erb
index 5db5e55..6fc6e78 100644
--- a/app/views/region_validators/region.html.erb
+++ b/app/views/region_validators/region.html.erb
@@ -5,7 +5,7 @@
<% for validator in @region.validators %>
-
- <%= link_to_homepage validator.name, validator.identifier %>
+ <%= link_to_homepage validator.name, validator %>
<%= link_to _('Remove validation rights'), { :action => 'remove', :id => @region.id, :validator_id => validator }, :method => 'post' %>
<% end %>
diff --git a/app/views/search/_full_enterprise.html.erb b/app/views/search/_full_enterprise.html.erb
index 38de832..6b739a7 100644
--- a/app/views/search/_full_enterprise.html.erb
+++ b/app/views/search/_full_enterprise.html.erb
@@ -5,7 +5,7 @@
@order == 'more_recent' ? enterprise.send(@order + '_label') + show_date(enterprise.created_at) : enterprise.send(@order + '_label') %>
- <%= link_to_homepage(enterprise.name, enterprise.identifier, :class => "search-result-title") %>
+ <%= link_to_homepage enterprise.name, enterprise, class: "search-result-title" %>
<% if enterprise.description %>
<% body_stripped = strip_tags(enterprise.description) %>
diff --git a/app/views/search/_full_product.html.erb b/app/views/search/_full_product.html.erb
index 541cae1..78090a9 100644
--- a/app/views/search/_full_product.html.erb
+++ b/app/views/search/_full_product.html.erb
@@ -44,7 +44,7 @@
<%= link_to_product product, :class => 'search-result-title' %>
- <%= _('Supplier') %> <%= link_to_homepage(product.enterprise.name, product.enterprise.identifier) %>
+ <%= _('Supplier') %> <%= link_to_homepage product.enterprise.name, product.enterprise %>
<% if product.description %>
diff --git a/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb b/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb
index 47b1abe..3be6651 100644
--- a/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb
+++ b/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb
@@ -10,7 +10,7 @@
<%= profile_image_link organization, :big, 'div' %>