options_from_collection_for_select

I've looked at the API on this but can't quite see what I'm missing from my call

<select id="pay[pay_id] name="pay[pay_id]">   <%= options_from_collection_for_select(    Pay.find_all_by_name, "id", "name") %> #<- line 5 </select>

is returning - Showing app/views/kr/index.rhtml where line #5 raised:

wrong number of bind variables (0 for 1) in: pays.`name` IS ?

Anyone ?

TIA Stuart

wrong number of bind variables (0 for 1) in: pays.`name` IS ?

Anyone ?

This is because you haven't specified an argument in your 'find_all_by' query - it is expecting Pay.find_all_by_name("my name").

What I expect you're trying to do is either just find all the records:

Pay.find(:all)

Or find all the pay records but only select the name and id:

Pay.find(:all, :select => "id, name")

Hope that helps,

Steve