Refactor courses feature using rails resources