add erubis support
refactor controller class into controller.rb