The working answer was this:
def create
@community = current_user.communities.create(params[:community])
respond_to do |format|
if @community ...
The problem was using build and then @community.save. This did not save the association. Using .create automatically calls new and save and creates the association.