Im having trouble figuring out how to query my database in ruby and
i’m hoping someone can help me out.
I’d like to find all my departments that match a permalink passed from
the url. The department must also match a particular category, also
passed through the url.
I have written the following code. But unfortunatley I get an error
“wrong number of arguments (2 for 1)”
category = params[:category]
department = params[:department]
@departments = Department.find(:all, :conditions => [“permalink = ?”,
@department = @departments.find(:all, :conditions => [“category = ?”,
If anyone could shed some light on this it would be greatly appreciated.