Find WHERE in Rails

sean colquhoun wrote:

Wow. So basically, symbols are not variables and also not strings. They
can’t be set, but logically that seems like an invalid statement to me,
since we can use the :id symbol from a form, and that obviously has been
set, because it can return an integer like ‘5’ and not just ‘id’. If it
could only return ‘id’, it would be useless to any program unless that
program was a program about the two letters ‘i’ and ‘d’.

:slight_smile:

So symbols aren’t set, but they can be, like, ‘born’ (?) somehow or else
they just exist perpetually. But it seems unclear how to control them.
Holy jeez this is confusing. I think I’ll be investing in that Pickaxe
Book soon.

It’s worth every penny. :slight_smile:

Jeff

But if you really want to get into the concept and use of symbols in
programming languages, you should study Lisp :slight_smile:

Thanks. You cleared that up for me. Unfortunately, however, I graduated
with a degree in graphic arts and the most challenging thing I’ve done
so far was program a mini-CMS for myself (ha ha ha-one page only-but it
does the trick) in PHP. OOP is something of a leap for me. i’m going to
have to take it one tongue at a time for the time being.

:wink:

“sean” == sean colquhoun [email protected] writes:

Wow. So basically, symbols are not variables and also not strings.

Exactly. They are symbols. You can think of them as free-floating
names, in a way.

They can’t be set, but logically that seems like an invalid
statement to me, since we can use the :id symbol from a form, and
that obviously has been set, because it can return an integer like
‘5’ and not just ‘id’.

No, you have misunderstood here. Parameters from a form come to your
controller in the form of a hash. When you write params[:id], you’re
just using the :id symbol as a key into that hash, and you get the
value 5 back. :id has no value other than :id, but the params hash has
a value keyed to the name :id. Do you see the difference?

Holy jeez this is confusing. I think I’ll be investing in that
Pickaxe Book soon.

That would probably be an excellent idea, yes. Knowing Ruby makes it a
wee bit easier to program in Ruby, to put it mildly.

But if you really want to get into the concept and use of symbols in
programming languages, you should study Lisp :slight_smile:

	     Calle D. <[email protected]>
	 http://www.livejournal.com/users/cdybedahl/
 "Last week was a nightmare, never to be repeated - until this week"
			-- Tom, a.s.r