How to find the rails controller responsible for generating data for the current view?

How to find the rails controller responsible for generating data for the current view?
0

Many a time, it’s essential to find the rails controller being called to render the current view’s JSON. Here’s a simple way to do it.

  1. Go to the Network tab(according to your browser) and look for the ajax request which is fetching the data.

  2. Check the value of x-discourse-route in response headers. It’s in the format controller/action.

2 Likes