Hi,
I am trying to update a field (date_accepted) in my view by clicking a
button and using AJAX link_to_remote. The field is being updated but
then the progam bombs with “Template is missing Missing template
script/…/config/…/app/views/admin_client/accepted.rhtml”
This is my code: Controler “admin_client”
def accept_list
@consultant = session[:consultant]
@clients = Client.list_clients(@consultant)
render :layout =>‘admin_client’, :action => ‘accept_list’
end
def accepted
begin
@client = Client.find(params[:id])
rescue ActiveRecord::RecordNotFound
logger.error(“Attempt to access an invalid product
#{parems[:id]}”)
redirect_to :action => :accept_list
else
@client.date_accepted = Date.today
@client.update_attributes(params[:client])
end
end
This is my view “accept_list”
<% for client in @clients -%>
<%= h(client.primary_whole_name) %> |
Quote No.: |
<%= h(client.id) %> |
|||
<%= h(client.addr1) %> | Work: | <%= h(client.w_ph) %> | Date
accepted: |
<%= h(client.date_accepted) %> |
<%= link_to_remote( "Accept", :update => "accepted", :url =>{ :action => :accepted, :id => client }) %> |
<%= h(client.suburb) %> | Home: | <%= h(client.h_ph) %> | Date follow up: | <%= h(client.date_follow_up) %> | |
<%= h(client.city) %> | Mobile: | <%= h(client.mobile) %> | Date captured: | <%= h(client.date_entered) %> | <%= link_to 'Show', :controller => 'quote', :action => 'show_consultant', :id => client %> |
<%= mail_to(client.email, h(client.email), :subject => "Your Quote", :encode => "javascript") %> | Fax: | <%= h(client.fax) %> | Total value of Quote (ex. gst) : | <%= format_price(client.tot_value) %> |
advice will be most appreciated.
Regards,
Paul