これは私の見解です:
<%= link_to_remote "Responded - Positive",
:url => contact_path(@contact, :status => 'positive response'),
:update => "status" %>
これは私がルートとして持っているものです:
map.resources :contacts, :has_one => :status_contact
コントローラーで使用したものは次のとおりです。
def create
@status_contact = StatusContact.new(params[:status_contact])
if @status_contact.save
#flash[:notice] = "Successfully created status contact."
#redirect_to @status_contact
render :text => "Set status to #{@status_contact.status}."
else
render :text => "bomb"
end
end
私の望む結果は、特定の連絡先について、属性 Contact.status を値「肯定応答」で更新し、ajax を介して更新することです。
現在、404 エラーが発生しています。これを修正するにはどうすればよいですか?
これは私がまだ得ているエラーです:
POST http://localhost:3000/contacts/24?method=put&status=positive+response 404 Not Found
312ms