couldn't find with 'id'= in rails controller
<p>I am facing error <code>Couldn't find Course with 'id'=</code>.</p>

<p>Here is my course controller function of <code>manage_users</code>:</p>

<pre><code>def manage_users
  @course_users = (@course.users + (User.where(admin: true))) - [current_user]
  @other_users =  @users.where(admin: false) - (@course_users + [current_user]) 
end

private
 # Use callbacks to share common setup or constraints between actions.
 def set_course
  @course = Course.find(params[:id])
 end
 # Never trust parameters from the scary internet, only allow the white list through.
 def course_params
  params.require(:course).permit(:name, :start_date, :end_date, :branch_id)
 end
</code></pre>

<p><strong>routes.rb</strong></p>

<pre><code>resources :courses do
  get 'manage_users'
  put 'add_user'
end
</code></pre>

<p><a href="https://i.stack.imgur.com/N12vq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N12vq.png" alt="enter image description here"></a></p>