+ def better_errors_allow_inline
+ yield
+ rescue StandardError
+ append_content_security_policy_directives(
+ :script_src => %w['unsafe-inline'],
+ :style_src => %w['unsafe-inline']
+ )
+
+ raise
+ end
+
+ rescue_from CanCan::AccessDenied do |exception|
+ raise "Access denied on #{exception.action} #{exception.subject.inspect}"
+ # ...
+ end
+