I want to be able to change value for the :status_contact for the model Contact (has_one :status_contact
Here is the snippet with the link_to_remote:
<%= link_to_remote "Responded - Positive",
:url => contacts_url(@contact, :status => 'positive response'),
:update => "status" %>
<span id="status"></span>
Here are relevant Model definitions for Contact.rb
has_one :status_contact
alias_attribute :status, :status_contact
It seems from the error that perhaps I need to create special route?
http://localhost:3000/contacts/22
404 Not Found
How do i get it so that when I click on the link_to_remote, it makes the change to the value via ajax?
Update: New Error I made the change per below:
:url=> contact_path(@contact, :status => 'positive response')
I am not sure what action it is looking for in the controller. I do have an 'update' action. This is the URL that gets passed through the Firebug console:
http://localhost:3000/contacts/16?status=positive+response
<h1>Unknown action</h1>
<p>No action responded to 16. Actions: build_date_from_params, create, destroy, edit, index, message_sub, new, set_contact_delay, set_contact_email, set_contact_phone, set_contact_title, show, and update</p>