ruby - How can i delete from list while using ransack search in rails -


i trying delete list when trying getting deleted database

  @course = course.find(params[:id])       @search = lesson.search(params[:q])        @lessons = @search.result.paginate(:page => params[:page], :per_page => 10)               @search.build_condition if @search.conditions.empty?        @course.lessons.each |lesson|           @lessons.each |l|               if lesson.id == l.id         @lessons.delete(l)       end         end        end 

i getting error: delete_all doesn't support limit scope thanking you

delete activerecord method. assume don't want delete database result list. can this:

@course.lessons.each |lesson|   @lesson.reject { |l| l.id == lesson.id } end 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -