error when using link_to to create a like
when i'm clicking on the link i'm getting this error:
No route matches {:action=>"show", :controller=>"likes",
:doweet_id=>2}
this is the link_to code:
link_to image_tag("/images/friends/thumbs-up.jpg"), like_path(:doweet_id => doweet.id), :method => :post
in the routes:
resources :likes
in likes controller:
class LikesController < ApplicationController
respond_to :html, :js
def create
@like = Like.new(:doweet_id => params[:doweet_id])
#push(comment)
flash[:notice] = "Like successfully created" if @like.save
respond_with( @like, :layout =开发者_Go百科> !request.xhr? )
end
end
link_to image_tag("/images/friends/thumbs-up.jpg"), likes_path(:doweet_id => doweet.id), :method => :post, :remote => true
精彩评论