adapt changes from rails_template