Looks like you'll need to rebase before we can merge this. I refactored the resources macro to do all code generation within itself. It's a stretch on function length, but I want to try and keep the code generation as straight forward as possible for now. https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/router/mapper.ex#L121-L150

This PR as is would squash those changes I think.