I've a simple posts model with title:string and rating:integer and I want to add the ability to rate the posts. So far I have
#Post controller
def increase
@post = Post.find(params[:id])
@post.increment! :rating
flash[:notice] = "Thanks for your rating."
redirect_to @post
end
#Post show
<%= link_to "Rating", increase_post_path %>
#Routes
map.resources :posts, :member => { :increase => :put }
When I click on rating, I get unknown action. I'm able to increase the rating when I add @post.increment! :rating to update, but not when I create my own method. Any suggetions?