首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

ruby可以这么写

2012-12-31 
ruby可以这样写@articles Article.order(created_at DESC).where(:group_id params[:group_id]).li

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

热点排行