cPanel password protect directories do not work for folders inside rails apps as Password protect directory works with Auth Directive in folder .htaccess files.
Rails app ignores these .htaccess directives.
you will have to use ruby inbuild HttpAuthentication functions for this purpose.