`
peryt
  • 浏览: 56337 次
  • 来自: ...
最近访客 更多访客>>
社区版块
存档分类
最新评论
  • waiting: 既然都指定了dataType为'script'那就不必特别在b ...
    jQuery

开发学到的东西

阅读更多

1.

options = User.all(:conditions => "status <> 3", :order => "firstname, lastname").collect{|x| [x.name, x.id.to_s]}

 

cars = Car.where(:colour => 'black').all   (adding .all means it will load the data with no waiting.)

 

cars = Car.find(1)

cars = Car.find(params[:id])

 

cars = Car.order('created_at ASC')

 

oldest_car = cars.first

newest_car =  cars.last

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics