Need Help on ruby

Hi everyone I’m trying to retrieve information from the ruby table based
on the selected “Select” tag option and it doesn’t work as expected

View

select class=“select_tutor” id=“tutor_list”>

Select Tutor All Online Offline

Controller

def session_booking

if params[:tutor_list] == ‘All’
@search_all_tutors = Tutor.all
elsif params[:tutor_list] == ‘Online’
@search_all_tutors = Tutor.where(availability: true)
elsif params[:tutor_list] == ‘Offline’
@search_all_tutors = Tutor.where(availability: false)
else
@search_all_tutors = Tutor.where(availability: true)

end

Thanks in advance

Hi everyone I’m trying to retrieve information from the ruby table based
on the selected “Select” tag option and it doesn’t work as expected

View

select class=“select_tutor” id=“tutor_list”>

Select Tutor All Online Offline

Controller

def session_booking

if params[:tutor_list] == ‘All’
@search_all_tutors = Tutor.all
elsif params[:tutor_list] == ‘Online’
@search_all_tutors = Tutor.where(availability: true)
elsif params[:tutor_list] == ‘Offline’
@search_all_tutors = Tutor.where(availability: false)
else
@search_all_tutors = Tutor.where(availability: true)

end

Thanks in advance