I am creating a Ruby on Rails application where it searches for certain classes according to their: model, session and year. Moreover, I need a check box to filter which class is being displayed on the screen.
The options include: VEX IQ and VRC. The way I was originally filtering this information was by doing the following:
<p><b> Saturday </b></p>
<% Klass.where(days_of_week: 'Saturday', model: params[:chckBox], session: 'Spring', calendar_year: '2018').order('name asc').count('id') do |ksa| %>
<li class="list"> <%= ksa.name %> </li>
<% end %>
When I added a check box, I tried doing the following:
<% if (params[:chckBox] == "true") %>
<%= puts "Chceck box is checked" %>
<% elsif (params[:chckBox] == "false") %>
<%= puts "Not checked" %>
<% end %>
I tried displaying the information to see what it would display, but it does not even do that. I need help haha. Please if you are able to understand what I am trying to do, just ask me again.