☒ In this example, the SECRECT_KEY_BASE is an environment variable and is used in the config/secrets.yml. Within AWS Beanstalk's Configuration Overview (Elastic Beanstalk > Environments > Your App > Configuration), you can create an Environment Property which is where you set the environment variables. Any environment variable set here will be available to the EC2 instances that are created.
☒ Check out the video on streaming videos where it shows how to use the controller to send the Active Storage url instead of having it embed within the view. This may help protect the link as it is then able to be authenticated and authorized via the controller. https://www.driftingruby.com/episodes/streaming-videos-with-active-storage
☒ I would actually prefer a separate controller. When I first started out development, I would have several compromises with my controllers. First they were fat controllers, then they had various actions outside of the standards and so on. These all seemed fine until I had to go back and work on these older applications and these kinds of patterns were a pain to go back and work in. So, I would actually have a different controller and in this particular case, I would not have it dependent on articles. I would have probably do something like
resources :versions, only: [] do
resource :restore
end
The reason why I would prefer leaving the article out of it is that the polymorphic association in the Version table already knows who the item belongs to. So, we can look up that item and do the necessary checks. I also like this way because then we can write it one time, and not have to worry about all of the different Action Text attributes used by other models; this solution would work for all of them.