读书人

ruby可以这么写

发布时间: 2012-12-31 11:57:52 作者: rapoo

ruby可以这样写
@articles = Article.order("created_at DESC").where(:group_id => params[:group_id]).limit(5)

@count = Article.where(:group_id => params[:group_id]).count

@group = Group.where(:school => params[:school], :name => params[:name], :is_audited => true).first

redirect_to root_path,:notice => "There is no group in #{params[:school]}." if @groups.size == 0

读书人网 >Ruby Rails

热点推荐