Skip to content

Commit

Permalink
We don't need multiple helpers to do one thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric de Villamil committed Aug 29, 2013
1 parent 8d13f99 commit cc71bcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions app/helpers/admin/base_helper.rb
Expand Up @@ -80,17 +80,13 @@ def task_overview
content_tag :li, link_to(_('Back to list'), :action => 'index')
end

def render_empty_table(cols)
def render_void_table(size, cols)
return unless size == 0
content_tag(:tr) do
content_tag(:td, _("There are no %s yet. Why don't you start and create one?", _(controller.controller_name)), { colspan: cols})
end
end

def render_void_table(size, cols)
return unless size == 0
render_empty_table(cols)
end

def cancel_or_save(message=_("Save"))
"#{cancel} #{_("or")} #{save(message)}"
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/content/_article_list.html.erb
@@ -1,4 +1,4 @@
<%= render_empty_table(7) if @articles.empty? %>
<%= render_void_table(@articles.size, 7) %>
<% for article in @articles %>
<tr>
<td>
Expand Down

0 comments on commit cc71bcc

Please sign in to comment.