I'm sure I've seen this question posted here before, but I could not find it.
What I want to do is use a name in my url instead of an id, then use the .find method to get the correct record.
URL = http://www.foobar.com/person/show/Bob
In PersonController for the action 'show' I want to end up with SQL that looks like "SELECT * FROM people WHERE name = 'Bob'", but I want to just use the .find method to keep my code more readable. Right now I am trying this:
@person = person.findall, :conditions => params["name"])
I don't get an error, but @person is not defined in the view, so it's obviously not getting the record.
Any help is appreciated.