# articles_helper.rb - a sample script for Ruby on Rails # # Copyright (C) 2005-2008 Masao Mutoh # # This file is distributed under the same license as Ruby-GetText-Package. # # ArticlesHelper is bound a textdomain which is bound in application.rb or # articles_controller.rb. # So you don't need to call bindtextdomain here. # module ArticlesHelper def show_article(article, show_link = true) ret = %Q[
#{article["description"]}] if show_link ret += %Q[
#{link_to(_("Show"), :action => 'show', :id => article)}
] end ret end def show_list(articles) ret = "" articles.each_with_index do |article, index| ret << %Q[