The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From: Jeff Lockyer <li...@ruby-forum.com>
Date: Wed, 07 Nov 2012 21:07:16 +0100
Local: Wed, Nov 7 2012 3:07 pm
Subject: find_by_sql - ActiveRecord - Help please.
I am new to the language and trying to add a couple of simple tests on
user input, followed by a DB query, then using the returned values (where the problem lies) I first run a find_by_sql similar to this
@my_names = modelname.find_by_sql
I then check to see if NO returns via
if @my_names.size == 0
==================
My question is, how do I access the values that are now in the array. I
session[:whatever] = @my_names[0].column_name
but am unable to perform a if construct that looks like
if @my_names[0].column_name == "TEST VALUE"
I keep getting an undefined method error when I try to run the code.
-- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||