I want to fetch data from db based on some search string. But I am getting the exception
undefined method `find_all_by_client_name' for ...
Can someone tell what's the issue with the code?
@workout_schedules = WorkoutSchedule.find_all_by_client_name(params[:search_string])
Following is the schema for workschedule
ActiveRecord::Schema.define(version: 20140804052924) do
create_table "workout_schedules", force: true do |t|
t.string "client_name"
t.string "trainer"
t.integer "duration_mins"
t.date "date_of_workout"
t.decimal "paid_amount"
t.datetime "created_at"
t.datetime "updated_at"
end
end