similar to: Paginating an existing array

Displaying 20 results from an estimated 50000 matches similar to: "Paginating an existing array"

2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
The built-in Rails pagination is fairly limited...you pass in the model name, and optionally some conditions, and it generates a paginated query for you. This gets to be very bad if you''ve got any custom queries. class Company < ActiveRecord::Base def complete_videos Video.find :all, :conditions => "company_id=#{id} AND status=''complete''", :order
2012 May 22
4
undefined method `paginate'
I am working with Railsspace social networking book. I stuck in the problem when i am doing paginate for the search result. It gives the following error. NoMethodError in CommunityController#index undefined method `paginate'' for #<CommunityController:0x57436f0> My Controller Index page coding is below def index @title = "Community" @letters =
2013 Oct 24
6
undefined method `paginate' for #<Class:0x567eb98> in Rails Tutorial
Hi, I''m getting a undefined method `paginate'' for #<Class:0x567eb98> even though I have gem ''will_paginate'' installed. Inside the users_controller I have @users = User.paginate(page: params[:page ]) so I believe I set everything up to be correct. Can you figure out why the method''s undefined, despite installing the gem? -- You received this
2010 Aug 24
11
will_paginate problem
Hi I am using rails 2.3.8 & ruby 1.3.7 & will_paginate 2.3.14 I have table name books. I am doing this code for pagination, In book_controller @@@@books = Book.paginate :page => params[:page], :per_page => 10@@@@ & in index.html.erb @@@@@<%= will_paginate @books %>@@@@@ Also added in environment.rb file this line @@@@@ require
2011 Feb 17
1
Adding images for pagination links in will_paginate
Hi, I am using will_paginate for pagination. I have to show only Previous and Next links, that I have achieved by ":page_links=>false" parameter. Now I want to show the images instead of "Previous" and "Next" labels. Can anyone tell how to achieve this in will_paginate? Thanks, Tushar -- Posted via http://www.ruby-forum.com/. -- You received this message
2010 Jan 07
2
Find by looping thru array
Hello all, I''m in my third month of Ruby on Rails. I think it''s coming along fairly well. My current issue is this. I''m do a search based on string data some of which is very long. So I''m doing a similar match using "amatch" gem. When I have a 50% or greater match I store the id to an array. How can I do a find looping thru the array then send the
2008 Jun 21
15
will_paginate generates undefined method paginate
Dear I used to use the will_paginate plugin, and now it is no longer available in the repository. I am using the one in the gem #gem install will_paginate in my controller I have this @careers = Career.paginate :page => params[:page], :per_page => 10 and in the view <%= will_paginate @careers %> I found this way in all the tutorials and the railscasts episode 51. Though I still
2010 Jul 30
1
pagination
Pagination I am using an old tutorial which is tripping me right up as I have the latest version of rails installed. I''m persisting as I think I''m learning a little bit more about how RoR works. However after installing the scaffolding plug-in to fix an earlier problem I now have a problem with the pagination. I have followed this workaround:
2009 Nov 26
6
will_paginate don't work on jruby platform
Hello all,will_paginate don''t work on jruby platform, the Model.paginate find works ok, accepts all kinds of params, this is config.gem config.gem ''will_paginate'', :version => ''2.3.11'', :source => ''http://gemcutter.org'', but <%= will_paginate @collection %> doesn''t work it always produce nil(so nothing on page).
2010 Jan 05
2
Conditional named_scope chaining with params (Need help)
Hello there, I have a model that has more then one named_scope. In my action Index of the controller that handle this model I want to do this in a drier way: if params[:ownership] == "mine" @posts = Post.tagged_with(params[:tags], :on => :tags).owner(current_user.id).paginate :all, :page => params[:page], :order => ''created_at DESC'' else
2006 Nov 08
0
Paginating a fetched resultset problems with next/previous
Im using this paginate function to paginate complex sql queries http://www.bigbold.com/snippets/posts/show/389, all seems to work fine but theres one thing, when i hit the next link it show nothing, i mean it only shows the first page, here is the code im using: #application.rb----------------- def paginate_collection(collection, options = {}) default_options = {:per_page => 10, :page
2005 Dec 09
0
Paginating HABTM
Is there a good way to use the Pagination Helper to paginate HABTM collections? For example: If Foo HABTM Bars, how can I paginate Foo''s Bars? -- john david schult usa : georgia : buford m: 404.510.5163
2010 Sep 11
10
Having difficulty with threaded comments, using acts_as_tree
I''ve been having problems making threaded comments for the last few days. Mainly with creating children and displaying the children. Currently, I have comments shown at the bottom of my articles show view. The top level comments work, but I do not really know how to implement a way for users to "reply" to the top level comments and take them to a form (the comment
2008 Mar 06
1
pagination for an object array
def show_details @sd_ticket = ServiceDeskTicket.find(params[:id]) @servicedesk_cis = @sd_ticket.service_desk_cis end What I need is a pagination for @servicedesk_cis using the custom pagination..How can i give offset and limit to this? I have successfully done previously custom pagination in another def as below def search_sd_ticket @search_sd_ui_hash=params[:sd_ticket]
2011 May 26
3
Kaminari rspec testing undefined method page.
Someone use kaminari for pagination? I''m doing some tests but I don''t know why I have an undefined method page. Here is my simple test: describe "GET index" do it "assigns all fire_preventions as @fire_preventions" do FirePrevention.stub(:search) { [mock_fire_prevention] } get :index assigns(:fire_preventions).should
2012 Feb 23
4
Undefined Method
Hi all, I am currently trying to get a bunch of links to to display all the related console records upon button click so e.g. If a user clicks on the Dreamcast link then I would like it to display all records that have Dreamcast stored as their console. I have the following example code in my index class: <%= link_to ''DREAMCAST'', games_path(:console =>
2010 Jan 21
2
will_paginate ?
Does anyone have experience with will_paginate? I''m trying to use it with acts_as_ferret. routes.rb ... map.search ''/search'', :controller => ''notes'', :action => ''search'' notes.rb ... acts_as_ferret :fields => [ ''body'' ] notes_controller.rb ... def search if params[ :query ] @query = params[
2012 Oct 10
4
How do we get the End of Line date for the gems which we are using Ruby on Rails?
Hi All, I want to know the EOL date for the below gems for ROR. Can anyone help me how to find the EOL dates - authlogic - will paginate - oauth-plugin 0.3.14 - statistics 0.1.1 - YUI - cucumber 0.6.4 - cucumber-rails 0.3.0 - rspec 1.3.0 - rspec-rails 1.3.2 - webrat 0.7.0 - factory-girl 1.2.4 - database_cleaner 0.5.0 - SSL requirement - calender_select
2010 May 16
3
searchlogic
Hey The guys at the searchlogic google groups seem to be asleep -.- They didnt'' grant me permission to post yet. But anyways, right now, I followed the searchlogic tutorial found here -http://www.binarylogic.com/2008/09/07/tutorial-pagination-ordering- and-searching-with-searchlogic/ however, in that tutorial, the results of the find displays all my items, before i even search for
2010 Sep 21
25
Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Hello, I''m working to install the acts_as_commentable plugin on my Rails 3 app. After adding "acts_as_commentable" to my book model, I then added a comment form on my book show view: <% form_for(@comment) do|f| %> <%= f.hidden_field :book_id %> <%= f.label :comment %><br /> <%= f.text_area :comment %> <%= f.submit "Post