How can one use the rails environment variables within the application?
I am trying to use them to limit access to certain elements on the page. E.g. the users do not see the information an admin does; but the rest of the page is the same. Is there a best practice for such user privilege implementations?
I don't get why you want to use environment variable for it. If you want to limit access to certain elements on the page (or/and actions), you can use gems like cancancan (https://github.com/CanCanCommunity/cancancan) or pundit (https://github.com/elabs/pundit) if auth rules are complex. But if your rules are very simple, you can just do smth like:
in the view.