similar to: How to fetch the previous or next record

Displaying 20 results from an estimated 3000 matches similar to: "How to fetch the previous or next record"

2006 Aug 09
10
Next/ Previous record
Hi, Quick question (which means that I think there should be an easy answer)... When I am in the "show" view, I''d like to add 2 links, one for previous and one for next record so that the user can go on to the next "result" without having to go back to the ''list'' of results. However, I can''t find my way about this problem :-S
2007 May 01
3
ActiveRecord Previous/Next Record
Does ActiveRecord offer a simple solution to get previous/next records relative to a certain record? For instance, say I have this table: PEOPLE id | name 1 | john 2 | mary 3 | bob Using p = Person.find(2), is it possible to get the previous (john) and next (bob) records using perhaps something like p.previous and p.next? If not, how can I do this without resorting to ugly queries? Thanks in
2006 Mar 30
2
acts_as_ordered plugin
Hey all, I''ve just put together a little plugin to easily access the neighbours of a given model in a particular order. Read on if interested. Install: script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_ordered Usage: class Person < ActiveRecord::Base acts_as_ordered :order => ''first_name'' end Say you have people with first
2006 Apr 12
2
Collection has next question
Hi, I know about pagination but dont want to use that option if it all possible. How in a collection of posts can i check if the there is a next item in the collection and then add that an object. For instance: //Returns all the posts into a collection called posts @posts = Post.find(:all) //Returns a specific post based on an id @post = Post.find(params[:id]) //How can i return the next
2006 Aug 05
2
How to code partial search value in a find command
Hello, In a list view, I''m trying to list a subset of a table''s records based on a partial search value. So if the user enters " Smith " then the view should list all records with " Smith " as the value of the relevant field. I have this partial listing of the Find view: Enter name to find <%= start_form_tag :action =>
2006 Jul 02
1
acts_as_modified, acts_as_ordered and validates_date_time
A quick note about acts_as_modified, acts_as_ordered and validates_date_time. If you are using any of those plugins you should update them. They''ve all had improvements/bug fixes. Also, acts_as_modified is now being maintained by both Chris Hall and myself. http://svn.viney.net.nz/things/rails/plugins/acts_as_ordered http://svn.viney.net.nz/things/rails/plugins/acts_as_modified
2006 May 29
4
Prompting user to enter value to feed Find
Hi, While viewing part of a long list of records, the user may want to do a Find of a specific record (for example, find_by_name). The found record is then displayed using the list view. I''ve searched the wiki and couldn''t find a sample or information that will help directly in implementing this function. Any pointers? Thanks! gk -- Posted via http://www.ruby-forum.com/.
2006 Jul 03
2
Still struggling with data flow ...
Hello, The following view: <%= start_form_tag %> Enter term to find <p> <%= text_field_tag :name, params[:name] %> </p> <%= link_to "Find", { :action => ''find_term''} %> <%= end_form_tag %> does not appear to pass back the value of :name to the action: def find_term term =
2006 Aug 06
6
View passing empty or no value to controller -- help
Hi, I have the following view: <%= start_form_tag ( { :action => ''find'' }, :method => ''get'') %> <p> <%= text_field_tag :lemma, params[:lemma] %> </p> <%= link_to "Find It", :class => "submit" %> <%= end_form_tag %> And the following find action in the controller:
2008 Apr 16
3
Linking to "Next Entry >>" from the current Entry Page
Hi all, I''m trying to link to the "Next Entry >>" from the current entry page (in show.html.erb). Any one know how I would do it? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2006 Jun 27
4
Not Active Record Model Validation
I have a problem with ruby on rails validation total_book_toy.rhtml ================ <%= text_field ''book1'', ''title1'' %> <%= text_field ''book2'', ''title2'' %> I want to validate these text_field so user can''t insert same title. However, I was stuck how to do it. Or maybe you have another way how to do it.
1998 Sep 02
1
Win95 and Smbmount
Hi, When I "smbmount" a shareable drive on my linux box, the result of the "ls" command is often false. (Kernel is compiled with "SMB Win95 bug work around" and "SMB filesystems support", Linux 2.0.34, RedHat 5.1, Samba 1.9.18p5) What can I do to solve my problem ??? Thanks a lot for your help. Michel
2006 Jun 11
7
testcase_setup_and_teardown_with_blocks (aka "The plugin with the very long name")
Hey all, I got annoyed recently that I couldn''t specifiy multiple chunks of test setup and teardown code that get executed for each test. You''re currently limited to just one setup method (unless I''m much mistaken). Anyway, I just wrapped up my solution in a plugin. The answer: use blocks! class Test::Unit::TestCase # This is overridden by the subclass and will
2006 Mar 23
5
validates_dateness_of ?
Hello all. I don''t suppose some enterprising soul with much more skill than me has whipped up a "validates_dateness_of" (Complete with leap year calculations) method for use with all the other validation methods and wishes to spread much much joy? Cheers Jeff "I can barely code RoR and rely on others to do the hard work" Jones -- Posted via
2001 Mar 08
2
Error: Looping in FIND_NEXT !
Excuse me but i re-post my question, please someone help me ? I have a little problem with samba. I use samba 2.0.3 on a linux 2.0.38 system. I want do a netbios connexion between my linux system with the smbclient command and a share on a windows 3.11 system. I make correctly the connexion with smbclient, and when type ls or dir, smbclient respond with Error: Looping in FIND_NEXT?? What
2009 Mar 09
1
lme anova() and model simplification
I am running an lme model with the main effects of four fixed variables (3 continuous and one categorical – see below) and one random variable. The data describe the densities of a mite species – awsm – in relation to four variables: adh31 (temperature related), apsm (another plant feeding mite) awpm (a predatory mite), and orien (sampling location within plant – north or south). I have read
2006 May 25
5
Is there a way to abstract the updating of other parts of the page after an Ajax request without putting using the standard view file?
Hey all, I''d like to abstract the process of updating different portions of the page after an Ajax request has taken place. Rather than simply putting the extra view logic in the standard rjs template, it seems to give better separation if there is a split between the core view logic (ie, inserting a row in a table), and updating any associated portions of the page. Is this possible? I
2006 Jun 15
4
parse only seem to understand US date format
I''ve tried Time.parse() and DateTime.parse() but they interpret the date as US format. Is there any way to tell it to interpret as dd/mm/yyyy? -- Posted via http://www.ruby-forum.com/.
2005 Apr 17
2
array indexing and which
Hi R friends! I am stuck with a stupid question: I can circumvent it but I would like to understand why it is wrong. It would be nice if you could give me a hint... I have an 2D array d and do the following: ids <- which(d[,1]>0) then I have a vector gk with same column size as d and do: ids2 <- which(gk[ids]==1) but I can't interprete the result I get in ids2. I get the
2001 Oct 03
5
Could not connect to a Win3.1 share
Hello! A problem: Samba (2.0) can log in to a Win31 share (I get a prompt), but after that I obtain smb: \> ls Error: Looping in FIND_NEXT?? ERRSRV - ERRerror (Non-specific error code.) listing \* 51250 blocks of size 8192. 26860 blocks available If I try to get some file that exists, I obtain smb: \> get Anu.doc Error opening local file Anu.doc What could be the