Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9112: deprecated_notice_about_paginate_in_README_patch.diff

File deprecated_notice_about_paginate_in_README_patch.diff, 2.2 kB (added by avocade, 1 year ago)

minor updates to README, scaffold.rb and index.erb in actionpack

  • actionpack/lib/action_controller/scaffolding.rb

    old new  
    106106 
    107107 
    108108          def list#{suffix} 
    109             @#{singular_name}_pages, @#{plural_name} = paginate :#{plural_name}, :per_page => 10 
     109            @#{plural_name} = #{class_name}.find(:all) 
    110110            render#{suffix}_scaffold "list#{suffix}" 
    111111          end 
    112112 
  • actionpack/lib/action_controller/templates/scaffolds/list.erb

    old new  
    1919<% end %> 
    2020</table> 
    2121 
    22 <%= link_to "Previous page", { :page => instance_variable_get("@#{@scaffold_singular_name}_pages").current.previous } if instance_variable_get("@#{@scaffold_singular_name}_pages").current.previous %> 
    23 <%= link_to "Next page", { :page => instance_variable_get("@#{@scaffold_singular_name}_pages").current.next } if instance_variable_get("@#{@scaffold_singular_name}_pages").current.next %>  
    24  
    2522<br /> 
    2623 
    2724<%= link_to "New #{@scaffold_singular_name}", :action => "new#{@scaffold_suffix}" %> 
  • actionpack/README

    old new  
    177177  {Learn more}[link:classes/ActionView/Helpers/JavaScriptHelper.html] 
    178178 
    179179 
    180 * Pagination for navigating lists of results. 
     180* Deprecated: Pagination for navigating lists of results. 
    181181 
    182     # controller 
    183     def list 
    184       @pages, @people = 
    185         paginate :people, :order => 'last_name, first_name' 
    186     end 
    187  
    188     # view 
    189     <%= link_to "Previous page", { :page => @pages.current.previous } if @pages.current.previous %> 
    190     <%= link_to "Next page", { :page => @pages.current.next } if @pages.current.next %> 
    191  
     182    Pagination is deprecated and will be removed in Rails 2.0. It's recommended that you instead use the superior 'will_paginate' plugin. 
     183         
    192184  {Learn more}[link:classes/ActionController/Pagination.html] 
    193185 
    194186