added resources to routes.rb. Added actions to posts controller