Don't think I really get how to fit everything I know to work together

Other than creating a post with AJAX and jQuery, I don't think I quite get how to make the leap from that specific example to, say, making the upvote button work. I feel lost in Rails. Think I conceptually get all the components, but can't quite fit them together seamlessly yet.