diff options
author | Philip Arndt <parndt@gmail.com> | 2010-12-10 23:48:36 +1300 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-12-10 23:48:36 +1300 |
commit | cf08283ccd66bb8644661b1a6ed8442fd4112553 (patch) | |
tree | 416d741d3b9d10b442e675269297c822be3c2f20 | |
parent | 6b9b639fd47799535a57f42e48df51af09535cd4 (diff) | |
download | refinerycms-blog-cf08283ccd66bb8644661b1a6ed8442fd4112553.tar.gz refinerycms-blog-cf08283ccd66bb8644661b1a6ed8442fd4112553.tar.bz2 refinerycms-blog-cf08283ccd66bb8644661b1a6ed8442fd4112553.zip |
<< is much faster than +=
-rw-r--r-- | app/helpers/blog_posts_helper.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb index 0f76f68..c428d18 100644 --- a/app/helpers/blog_posts_helper.rb +++ b/app/helpers/blog_posts_helper.rb @@ -3,8 +3,8 @@ module BlogPostsHelper posts = BlogPost.select('published_at').all_previous return nil if posts.blank? html = '<section id="blog_archive_list"><h2>' - html += t('blog.shared.archives') - html += '</h2><nav><ul>' + html << t('blog.shared.archives') + html << '</h2><nav><ul>' links = [] posts.each do |e| @@ -16,11 +16,11 @@ module BlogPostsHelper month = l.split('/')[0] count = BlogPost.by_archive(Time.parse(l)).size text = "#{Date::MONTHNAMES[month.to_i]} #{year} (#{count})" - html += "<li>" - html += link_to(text, archive_blog_posts_path(:year => year, :month => month)) - html += "</li>" + html << "<li>" + html << link_to(text, archive_blog_posts_path(:year => year, :month => month)) + html << "</li>" end - html += '</ul></nav></section>' + html << '</ul></nav></section>' html.html_safe end |