RSS
热门关键字:  java  Ajax  JSP  JSF  Struts
当前位置 : 首页>Ruby>列表

rails集成extjs

来源: 作者: 时间:2007-09-19 点击:
1).to_i        
  •         size = (params[:limit] || 20).to_i   
  •         sort_col = (params[:sort] || 'id')  
  •         sort_dir = (params[:dir] || 'ASC')  
  •           
  •         page = ((start/size).to_i)+1  
  •       
  •         @movie_pages = Paginator.new(self, Movie.count, size, page)      
  •   
  •         @movies = Movie.find(:all,   
  •                              :select => "id, title, plot, date, genre, mpaa, directed_by",   
  •                              :limit=>@movie_pages.items_per_page,  
  •                              :offset=>@movie_pages.current.offset,   
  •                              :order=>sort_col+' '+sort_dir)  
  •     
  •         return_data = Hash.new()        
  •         return_data[:Total] = @movie_pages.item_count        
  •         return_data[:Movies] = @movies.collect{|u| {:id=>u.id,   
  •                                             :title=>u.title,  
  •                                             :plot=>u.plot,   
  •                                             :date=>u.date,   

  • 最新评论共有 0 位网友发表了评论
    发表评论
    评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
    用户名: 密码:
    匿名?
    注册
    Google Adsense
    相关文章