Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created April 26, 2011 07:53
Show Gist options
  • Save jugyo/941957 to your computer and use it in GitHub Desktop.
Save jugyo/941957 to your computer and use it in GitHub Desktop.
check sytax for rails erb
require 'action_view'
def sytax_check_for_erb(erb)
begin
ActionView::Template::Handlers::Erubis.new(erb).result
rescue SyntaxError
return false
rescue Exception
return true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment