Allow Rendering A View In A Specific View File Only


In my model’s ‘view’ file I have an ajax call that calls a view file(name: ‘branches’) containing a widget which I created to retrieve branches of that model and display them in ‘view’.

The ‘branches’ file renders perfectly in ‘view’.

If I try to access ‘model’/branches/SOME_ID directly from the browser it returns the data to the user.

My question is, is there a way to restrict the that data to appear only in the ‘view’ file?

I don’t want users to be able to retrieve the data by simply linking to a url.

Thank u in advance.