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
精彩评论