refactor posts controller
refactor post model
add #idx test