Displaying 20 results from an estimated 8000 matches similar to: "ActiveRecord Previous/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
2006 Aug 02
9
How to fetch the previous or next record
Hello,
Is there some built-in facility for fetching the Previous or Next record
from a table? Assume the command find_by_name has been issued, and the
variable @name contains the name "John Doe". I''m looking for something
like find_next(@name) and find_previous(@name). What''s a good way to
pursue if one has to roll their own methods?
Thanks for the help,
gk
--
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 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
2005 Feb 12
3
ActiveRecord not updating record
Hi,
I''m having some problems using ActiveRecord to update records in a
sqlite database. This isn''t exactly as rails question, since I''m
doing this initial import outside of rails, but I''m hoping someone
hear might have an idea as to what my problem is.
The basic problem is with the following code (which is run in a big loop)
m = Movie.find_by_title_and_year
2007 Mar 27
6
how does rails do this "find_by_?"
Hello there,
I''m wondering how do they create functions on the fly?
find_by_any_column_name ??
I want to do something similar with my models, but I don''t really know
how to do it?
user_current_nickname
user_current_id
user_current_role
etc.?
Regards,
Jamal
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2006 Jul 06
6
Help with overriding / overwriting date values in ActiveRecord to accept Euro Style Date from a Textbox
Hi guys,
I''m trying to make an AR model which accepts a string data (from a
text input) in euro date format
eg
<input .... value = "23/01/2006"> ( 23 Jan 2006)
Reading the example from RDoc... i tried to
overwrite/overload/override the = function to write in the date..
Cant get it to work because .. i dont knoe what format should it
accept.. i''ve tried
2006 Mar 10
19
validates_date plugin for ActiveRecord
This plugin gives ActiveRecord the ability to do stricter date checking.
Example:
class Person < ActiveRecord::Base
validates_date :date_of_birth
end
This will ensure that date_of_birth is a *valid* date. The date can be set
initially as a string in any of the following formats:
"2006-01-01"
"1 Jan 06", or "1 Jan 2006"
"1/1/06" # Day /
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.
2006 Aug 06
1
ActiveRecord: determine if attribute has changed since save
Hello there,
i need to determine whether an attribute of my model has changed since the
last time it was saved. how can i do this?
greets
--
Michael Siebert <info@siebert-wd.de>
www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2005 Dec 16
6
active record outside of rails
I really like how Active Record logs the SQL that is executed inside of
rails. Is there a way to get the SQL output when using Active Record
outside of rails?
Thanks,
phil
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
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 May 10
13
Issue in ActiveRecord generated reader methods
Hi all!
I have come into a strange issue in Rails that I am hoping someone
can shed some light.
To make a very long story short, I have been researching how to
override ActiveRecord::Base#read_attribute and write_attribute to
perform security checks at the model level (influenced by the
ModelSecurity generator). Shortly after implementing some code to
check this behavior, I began to
2007 May 16
7
bilingual site: exclude fields set from query
Hi all,
Is there a way to have searches no use some indexed fields, when
processing a query?
context:
I have a model Foo that holds some information in two languages :
- text1_nl, text2_nl, text3_nl
and
- text1_en, text2_en, text3_en
Some other fields are common to both languages and indexed as well
- first_name, last_name
Depending on the visitor language choice I need to exclude the
2009 May 26
5
Help me...!!!
Hi to all...i'm a new R'user and i have to solve some exercies so i ask to
tou for an help...
1.) How i can demonstrate in R that the limit for x-->infinite of
(1+1/x)^x is equal to "e"?
2.) if i have a vector of values how can i create a function that, applied
to my vector, give me "median", "mean", "Var" and "length" togheter?
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
2012 Jun 23
3
Skype's no-redistribution policy
Hello:
Skype for Linux version 4 has recently been released. An RPM package has
been made, and it's mentioned in the Wiki:
http://wiki.centos.org/HowTos/Skype#head-
a08dbc518378653842007a2eec37bc32e13c0bd0
However, Microsoft claims to prohibit redistribution of Skype
(http://www.skype.com/intl/en-us/legal/terms/tou/ , subsection 4.2).
My feeling is that the Wiki shouldn't mention
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