similar to: Keeping sql query in session hash

Displaying 20 results from an estimated 10000 matches similar to: "Keeping sql query in session hash"

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
2006 Jul 07
0
Pagination and accessing old objects/parameters
Hi all, I am trying to use the pagination capabilities in a search tool that I have. A search view takes several parameters provided in text input and drop down boxes. Submitting the form causes a POST call to :action => ''search''. I generate some DB conditions based on the parameters and do a paginate. Everything gets shuttled off to the view again and things get rendered
2006 Jul 23
2
pagination_links and friendly urls
my pagination_links seems to auto generate the links using the current controller, action and id. The page they''re appearing on however have a friendly url I have created. I want to be able to make pagination urls generated by pagination_links "user friendly" as well so that they match my current naming convention.....i know there must be a way to do this....any ideas?
2006 Jan 19
8
Pagination_links without "?page=" but with params[:id]
Hello, With default pagination I have this : <a href="/users/infos/3?page=1">1</a> <a href="/users/infos/3?page=3">3</a> but i need this : <a href="/users/infos/1">1</a> <a href="/users/infos/3">3</a> I need to remove the "?page=" parameters and rewrite a little the link ( with a link_to ? )
2006 Mar 31
4
Question about pagination
Hi! I''ve got a list of project on the main page and if one of them is selected i render a partial using ajax with data of selected project. How to create links to next/previous project using pagination? -- Posted via http://www.ruby-forum.com/.
2006 Apr 27
2
How to override pagination_links method
I intend to override pagination_links method. I added following lines of code in application_helper.rb module ActionView module Helpers def pagination_links(paginator, options={}, html_options={}) raise("boom!!") end end end But my code is not executing my code. The view is still using the method pagination_links from rails. What''s the correct way to override
2005 Dec 19
2
Advanced search/filter use cases
I''ve been working on an application lately that has a lot of advanced search and filtering functionality (with ranges and substring searches for each attribute). Despite being a pretty common use case, this isn''t supported particularly well by any framework I''ve used, including Rails. I''d like to fix that. :) Right now, my major pet peeves are: 1. Long,
2006 Mar 22
4
How to write this SQL query?
Hi! Is there rails version of "where column in (value1, value2, ...)"? I know i could do OR many times, but this way is shorter. I''m ruby/rails newbie, so i have a problem with converting the hash, which i''m receving from the search form into the string for :conditions in find method. Could i instead of creating one, complicated (for me) query do something like
2013 Mar 14
0
Display custom links above top level arrays using Jbuilder
I have a custom JSON response in which I display a collection of 15 posts along with related data like comments etc., as part of an API call. I am displaying the entire collection using Jbuilder . json.array!(@posts) do |post| .. .. end I want to display pagination links above the response of the 15 posts, in order to get the next set of posts with the appropriate next set of next page and
2007 Feb 10
2
Ferret and Paginating Find
Hey all, I''ve been really happy with ferret thus far and all my search on my site is based on it. One of the recent challenges I ran into is changing some of my pagination within my site. Until now, I just used the tutorials out there that talk about how to get pagination working with acts_as_ferret. Recently, I decided to change my pagination to begin using the "Paginating
2006 Jul 12
2
Problem w/ Rails 1.1.4 and pagination_links using params?
I just installed version 1.1.4 and it seems like I started having problems with the pagination_links method. When I call the method using something like this (using the :params option--and this seems to be the problem), <%= pagination_links @todo_pages, :params => params %> then it duplicates part of the controller in the generated url. For example, before one of my paginator links
2007 Oct 03
3
Pagination problem with acts_as_ferret
Hi, am using this wonderful plugin acts_as_ferret and according to the tutorial at http://railsenvy.com/2007/2/19/acts-as- ? rial#basic I worked it out except the pagination feature. If I have 12 records and I give limit to 10, its correctly displaying 10 records in the first page and is giving the link to the second page too. But when I go to the next page I find the same 10 records instead of
2007 Jun 06
1
highlight and pagination
I made a search-field which shows all hits and highlights the all words searched for: def suche if params[:link][:suchfeld] == "description" @description = "show" @highlight = params[:suche] end @link_pages, @links = paginate :link, :order_by => ''url'', :conditions =>
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there, I''ve been trying to paginate over a list of members that all share a tag in common using the acts_as_taggable plugin. The regular way of paginating over a collection doesn''t seem to work with acts_as_taggable. Here''s what my method looks like that takes in a tag name, finds all the members that share the tag and then displays all the members. Nothing too fancy
2006 Feb 13
1
Paginate @member.items?
Is there a quick and easy way to paginate something like @member.items (Member with has_many :items)? Right now I do in the controller: @item_pages, @member_items = paginate :item, :conditions=>["member_id=?", @member.id], :per_page=>25, :order=>''datetime desc'' It''d be more DRY if this was possible: @item_pages, @member_items = paginate
2006 May 14
3
Beginner question on paginate with params and conditions
I am trying to do a simple search by product name. The first page returns fine, but when I try to go to any other pages of the search results, I lose the original search parameters from my search form and get NilClass errors. Here is the code in my controller: namesearch = "%" + params[:name].strip + "%" @product_pages, @products = paginate :product,
2006 Jan 26
21
pagination_links help
I want append custom query parameters to my pagination links, like ?page=1&foo=bar. I can''t quite figure out how to do this with the pagination_links helper, although I believe the API says you should be able to: pagination_links(paginator, options={}, html_options={}) options are: :params: any additional routing parameters for page URLs Has anyone tried this? thanks, jeff --
2006 Jun 07
2
Hash flattening on paginator link_to
Hey I need some help with pagination and the link_to in the view. I''m trying to include a hash in the pagination link_to params and it keeps flattening out my hash. Example: Here''s my hash called @answer: "answer"=>{"6"=>"9bf31c7ff062936a96d3c8bd1f8f2ff3", "7"=>"6f4922f45568161a8cdf4ad2299f6d23"}
2006 Jan 28
8
how to pass search parameters to pagination links
I have a search page with a text_field as below <%= text_field ''program'', ''program_name'' %> After I perform the search in my controller I go to a search results view which shows search results and uses Rails pagination. Now how to pass the search paramters (i.e. params[:program][:program_name] in my controller) to the pagination links (next and
2006 Aug 07
4
Problem with Pagination
Hi Guys, I am trying to paginate the results from a search. When I use actual constants in the search conditions, it works fine: def query @k2_result_pages, @k2_results = paginate (:k2_results, :conditions => [''e_date >= ? AND e_date <= ?'', ''2006-07-12'', ''2006-08-12''],