• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

I'm using Bootstrap 4 with Rails 6. Everything looks great until I use a dropdown to trigger a search. When the results are returned, all the controls on the page are duplicated, like the dropdown below:

Dropdown has duplicated

When I refresh the result page, the duplicates disappear:

enter image description here

I'm sure there must be a simple way to prevent this, but I'm entirely unfamiliar with WebPacker, so I've been unable to figure out a solution.

I'm using HAML, and the code to create the dropdown is plain vanilla:

        %label Institution         =select_tag "institution",  options_for_select(@institutions, params[:institution]), include_blank: true 

I'm not sure where to even look to try to find where the issue might be. It seems like the bootstrap js code is being called in a loop, with one iteration per page load.

Does this look familiar to anyone?

Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]