This is what I have in my view:
<%= link_to_remote "Responded - Positive",
:url => contact_path(@contact, :status => 'positive response'),
:update => "status" %>
This is what I have as a route:
map.resources :contacts, :has_one => :status_contact
Here is what I used in my controller:
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
My desired outcome is that for the specific Contact, it will update the attribute Contact.status with the value 'positive response' and do so via ajax.
Right now, I am getting a 404 error. What do I need to do to correct this?
This is the error that I am still getting:
POST http://localhost:3000/contacts/24?method=put&status=positive+response 404 Not Found
312ms