获取wrong number of arguments (2 for 1)
以下代码......任何想法?
@user_industry = current_user.industry
@industries = Listing.find_by_sql("SELECT * FROM listings WHERE industry = ?", @user_industry)
答案 0 :(得分:7)
您必须使用与AR find
相同的字符串替换 Listing.find_by_sql(["SELECT * FROM listings WHERE industry = ?", @user_industry])