Commit c6674dd32c1abde0ee3d70fa43498e9156a7ab89

Authored by Rafael Reggiani Manzo
1 parent e81f6ba4

Refactor FavoriteEnterprisesBlock footer

It was extracted into a helper and view which are the correct handlers
for such logic.
app/models/favorite_enterprises_block.rb
... ... @@ -12,14 +12,6 @@ class FavoriteEnterprisesBlock < ProfileListBlock
12 12 _('Favorite Enterprises')
13 13 end
14 14  
15   - def footer
16   - owner = self.owner
17   - return '' unless owner.kind_of?(Person)
18   - proc do
19   - link_to _('enterprises|View all'), {:profile => owner.identifier, :controller => 'profile', :action => 'favorite_enterprises'}, :class => 'view-all'
20   - end
21   - end
22   -
23 15 def profiles
24 16 owner.favorite_enterprises
25 17 end
... ...
app/views/blocks/footers/favorite_enterprises.html.erb 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +<% if block.owner.is_a?(Person) %>
  2 + <%= link_to _('enterprises|View all'), {:profile => block.owner.identifier, :controller => 'profile', :action => 'favorite_enterprises'}, :class => 'view-all' %>
  3 +<% end %>
... ...