You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
# app/policies/application_policy# Policies regulate access to your public models# The following policy will open up full access (but only in development)# The policy system is very flexible and powerful. See the documentation# for complete details.classApplicationPolicy# Allow any session to connect:always_allow_connection# Send all attributes from all public modelsregulate_all_broadcasts{ |policy| policy.send_all}# Allow all changes to public modelsallow_change(to: :all,on: [:create,:update,:destroy]){true}endifRails.env.development?
The problem is that when moving to production (or test) its not clear why you are suddenly getting 500 errors. We on purpose do not give any additional information when raising these errors (to avoid giving any details of what is going on to potential hackers.)
So the solution might be this:
# app/policies/application_policy# Policies regulate access to your public models# The following policy will open up full access (but only in development)# The policy system is very flexible and powerful. See the documentation# for complete details.# This policy will open up everything in development, and otherwise raise an # error. This is intended to just get you started. Normally you will want to run # the same policies in development, test and production, so once you have# defined a proper set of policies you no longer need to check which # environment you are in.classApplicationPolicyifRails.env.development?# Allow any session to connect:always_allow_connection# Send all attributes from all public modelsregulate_all_broadcasts{ |policy| policy.send_all}# Allow all changes to public modelsallow_change(to: :all,on: [:create,:update,:destroy]){true}elseraise"No policies defined - review and update 'app/policies/application_policy.rb'"endend