rubycentral / cfp-app

Rails app for managing a conference CFP
MIT License
223 stars 154 forks source link

Change set_cache_headers to before_action #302

Open jonsgreen opened 2 years ago

jonsgreen commented 2 years ago

Reason for Change

Changes

jonsgreen commented 2 years ago

@adarsh I tried to move the before_action filters into the actions but I discovered that the behavior of filters is quite special in that if you render or redirect in the filter it cancels the action. The set_cache_headers calls fresh_when which renders head :not_modified when fresh and the whole point is to cancel the action in those cases. I am sure there is some way to work around this but my guess is that you did not foresee that this would not be a trivial change to move the filters into the controller actions. Let me know if you want to discuss.