Commit 8320faf1
Changed files (6)
app
helpers
views
my
favorites
profiles
tutorial_tags
tutorials
app/helpers/creations_helper.rb
@@ -1,17 +0,0 @@
-module CreationsHelper
- def short_name(creation, length)
- if( creation.name.length > length)
- creation.name[0...length] + '...'
- else
- creation.name
- end
- end
- def shrink(name, length, default = nil)
- return default unless name.present?
- if name.length > length
- name[0...length] + '...'
- else
- name
- end
- end
-end
app/views/my/favorites/index.html.erb
@@ -13,7 +13,7 @@
<%= image_tag creation.primary_image.url_for(:thumb) %>
<% end %>
<div class="caption">
- <small><%= link_to shrink(creation.name, 12), cake_path(creation) %></small>
+ <small><%= link_to truncate(creation.name, length: 12), cake_path(creation) %></small>
</div>
</div>
</li>
app/views/profiles/_index.html.erb
@@ -9,7 +9,7 @@
<%= avatar_for(profile) %>
<% end %>
<div class="caption">
- <small><%= link_to shrink(profile.name, 20), profile_path(profile) %></small>
+ <small><%= link_to truncate(profile.name, length: 20), profile_path(profile) %></small>
</div>
</div>
</li>
app/views/profiles/show.html.erb
@@ -33,7 +33,7 @@
<%= image_tag creation.primary_image.url_for(:thumb) %>
<% end %>
<div class="caption">
- <small><%= link_to shrink(creation.name, 20), cake_path(creation) %></small>
+ <small><%= link_to truncate(creation.name, length: 20), cake_path(creation) %></small>
</div>
</div>
</li>
app/views/tutorials/index.html.erb
@@ -10,7 +10,7 @@
<%= image_tag tutorial.image_url, width: 240 %>
<% end %>
<div class="caption">
- <small><%= link_to shrink(tutorial.heading, 20), tutorial %></small>
+ <small><%= link_to truncate(tutorial.heading, length: 20), tutorial %></small>
</div>
</div>
</li>