recent_comments_sidebar.rb

来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· RB 代码 · 共 17 行

RB
17
字号
class RecentCommentsSidebar < Sidebar  description "Displays the most recent comments."  setting :title,     "Recent Comments", :label => "Title"  setting :count,     5, :label => "Number of Comments"  setting :show_username,  true, :label => "Show Username", :input_type => :checkbox  setting :show_article,   true, :label => "Show Article Title", :input_type => :checkbox  def comments    @comments ||=      Comment.find(:all,                   :limit => count,                   :conditions => ['published = ?', true],                   :order => 'created_at DESC')  endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?