added submitPost method to posts.js controller