Doc update: improve README example code.

    It makes more sense to check the published state of a post when attempting to edit.

    This change also updates the example to use Rails 4 idioms in the controller code.