开发者

Rails error "wrong number of arguments (1 for 0)"

I am using a scope to filter my results :

@hotels = @hotels.type(params[:hotel_type]) unles开发者_StackOverflows params[:hotel_type].blank?

with

scope :type, lambda { |type|
  self.scoped.where('hotel_type_id IN ( ? )', type.join(', ')) unless type.blank?
}

And params[:hotel_type] = ["2","3"]

Anyone can help me? I think it's because it's an array but i don't know how to fix this.

Thank you


i think you cant name your scope type, i'd name it by_type

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜