Results 1 to 5 of 5
Thread: default value in methods
May 1, 2006, 06:48 #1
- Join Date
- Jun 2004
- 0 Post(s)
- 0 Thread(s)
default value in methods
I have problems with default values. I don't know whether I'm stupid or doc is not good (you're not supposed to answer ) but I spend a lot of time for trivial things.
According to Wiki RailsBestPractices, it's a good idea to add a default value like that:
def self.custom_find( id_to_find = 1 )
[edit: the query is ok without = 0 default value ]
def self.find_query(category, type, city_id, price_min = 0, price_max)
sql conditions coming here...)
Did I miss something?