converted CRUD using active record