disable tags param if empty

This commit is contained in:
albert
2013-03-07 17:48:41 -05:00
parent 601c53b34a
commit 307bf5e57d

View File

@@ -16,7 +16,7 @@ class PostPresenter < Presenter
path = options[:path_prefix] || "/posts"
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{flags.join(' ')}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}" data-score="#{post.score}">}
if options[:tags]
if options[:tags].present?
tag_param = "?tags=#{CGI::escape(options[:tags])}"
elsif options[:pool_id]
tag_param = "?pool_id=#{options[:pool_id]}"