On my website I have a coding page that is directed to from homepage. With how I have set it up, when the user redirects to the coding page, they select a course button that I then grab the course_ID value and chuck it in the params:
<%= link_to "Complete Course", home_completeTask_path(course_id: enrolment.course_id), class:"btn btn-dark" %>
This redirects to the url: localhost:3000/home/completeTask?course_id=2 when the user selected course two.
Now here is the annoying part. all the variables I had set in the home_controller no longer worked, for example @mods = Mod.all to get all the mod table but typing Mod.all.[blahblah] worked fine, which makes me believe the controller is being thrown off somewhere.
I also have a header that checks for which type of user(student or staff) is logged in and offers the appropriate buttons to use. however on the completeTask page this no longer shows which makes me think that on that page the user isnt logged in or something.
If anyone has any fixes for these, any help is appreciated.