Table.find(@params["tag"])

ok this gets all records from the table where the id = tag how do i
change this for it to compare the "tag" with a other column apart from
the id?? sorry for being such a noob but thats what i am

···

--
Posted via http://www.ruby-forum.com/.

Ben Wright wrote:

ok this gets all records from the table where the id = tag how do i
change this for it to compare the "tag" with a other column apart from
the id?? sorry for being such a noob but thats what i am

Split the records into fields, compare the fields to each other:

table.each { |record|
   fields = record.split("\t") # assuming tabs as field separator
   print "Found it!" if fields[3] == fields[5]
}

Maybe it would be more productive and educational if you posted your code
and asked specific questions.

···

--
Paul Lutus
http://www.arachnoid.com

wel thanks ..i am very new to all this

the code is:

def list
  table.find(@params["tag"])
end

thats all

i'll have a look at wat you posted thanks

···

--
Posted via http://www.ruby-forum.com/.

ok forgott "tag" is being sent via the url and i want to use it to get
certain records from the db

···

--
Posted via http://www.ruby-forum.com/.

ok forgott "tag" is being sent via the url and i want to use it to get
certain records from the db

You are on the wrong mailing list my friend. You want the the Ruby on _Rails_ forum which can be found on the same site as you used to post here.

···

On Sep 9, 2006, at 2:35 PM, Ben Wright wrote:

--
Posted via http://www.ruby-forum.com/.

uups thanks ..as i saied i'm new

···

--
Posted via http://www.ruby-forum.com/.