Is there a way to disable the ERB handler in Rails.
This may sound silly but we’re migrating to SLIM and want to
prevent that some lazy developers still use ERB.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As far as I can see there’s no way to
unregistera template handler.But we can do it by means of a hack.
the
ActionView::Template::Handlers::ERBhas the following line;So lets break it, for fun.
We’ll add an initializer
config/initializers/no_erb_allowed.rbAny view that tries to use ERB will then raise the error