Ruby Newbie

Hi all,

Ruby and I are having a hard time bonding. I have a very basic question, and I hope that someone would be willing/able to assist me.

I have a simple web form where users may search by case number. I have my Controller set up to take a parameter, and query the DB with it. It appears that the parameter is getting set, but apparently the syntax I am using to query with is wrong. I am able to return a record when I hard-code a case number into the query statement, but not when I use a variable.

Now, if I were in php, this would be a breeze to solve... echo the value of the parameter to make sure it's getting set...echo the value of the query statement and make sure it's correct. Problem solved. Unfortunately, I don't know how to do even these simple error-checks in Ruby, and the books I have read are vague on this topic, to say the least.

Since Ruby is new here, I'll wait for a response before I start posting code snippetts of what syntax I've tried. I hope there are some Ruby humans out there that I can mingle with.

Still no dice. I tried it with and without curlies. Perhaps my problem lies elsewhere. I'm only making the assumption that it is picking up my param value, because when I have a syntax error, it shows the value of case_id - but perhaps it is not passing it to the controller. Do you know of a way to echo the param value to the screen so I can see what I'm passing?

The first form is a string, you know that. The second form is a symbol. The idea is that if you use a string many times, you should convert it to a symbol. When ruby gets bytecode compilation down, it will save some memory by only storing it once.

Well, believe or not, that worked! You're right, the reason I had named it that way was because when I was trying to load combo boxes in a different form, Rails wouldn't recognize the field unless it was associated with the table name...sheesh.
Wonder how that's going to work when I need to get combo box values back? Oh well - cross that bridge when I get to it I guess.