refactor rails post controller
refactor rails post controller