Post can't be updated
===

I tried to update a post and it tells me "Target language was successfully updated" but actually as soon as I hit the update button, the post goes back to original. I can't find any error messages in the log, anybody could help me?

The result when I run rake routes 

       project_target_langs GET    /projects/:project_id/target_langs(.:format)          target_langs#index
                             POST   /projects/:project_id/target_langs(.:format)          target_langs#create
     new_project_target_lang GET    /projects/:project_id/target_langs/new(.:format)      target_langs#new
    edit_project_target_lang GET    /projects/:project_id/target_langs/:id/edit(.:format) target_langs#edit
         project_target_lang GET    /projects/:project_id/target_langs/:id(.:format)      target_langs#show
                             PUT    /projects/:project_id/target_langs/:id(.:format)      target_langs#update
                             DELETE /projects/:project_id/target_langs/:id(.:format)      target_langs#destroy
                             POST   /projects/:project_id/target_langs/:id(.:format)      target_langs#update

My controller code 

    def update
      
        @project = Project.find(params[:project_id])
        @targetLang = @project.targetLangs.find(params[:id])
        
    
        respond_to do |format|
          if @targetLang.update_attributes(params[:targetLang])
            format.html { redirect_to project_path(@project), notice: 'Target language was successfully updated.' }
            format.json { head :no_content }
          else
            format.html { render action: "edit" }
            format.json { render json: @project.errors, status: :unprocessable_entity }
          end
        end
      end

Show.erb

    <% @project.targetLangs.each do |targetLang| %>
    		
    	<%= form_for([targetLang.project, targetLang]) do |f| %>
    		
    			<%= f.text_field :language, :class => 'textbox1' %> 
    			<%= f.text_field :status, :class => 'textbox1' %>
    			<%= f.text_area :notes, :size => "30x2", :class => 'textbox1' %>
    			<%= link_to 'Remove', [targetLang.project, targetLang],
    					:data => {:confirm => 'Confirm deletion!'},
    					:method => :delete %>
    			<%= link_to 'Update', [targetLang.project, targetLang],
    					:method => :update %>
routes.rb

    Dashboard::Application.routes.draw do
    	resources :projects do
    	resources :target_langs
    	match '/target_langs/:id' => 'target_langs#update', :via => :post	
    	
     end
My log

    Started GET "/projects/5" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Processing by ProjectsController#show as HTML
      Parameters: {"id"=>"5"}
      ←[1m←[35mProject Load (0.0ms)←[0m  SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1  [["id", "5"]]
      ←[1m←[36mTargetLang Load (0.0ms)←[0m  ←[1mSELECT "target_langs".* FROM "target_langs" WHERE "target_langs"."project_id" = 5←[0m
      ←[1m←[35mProject Load (0.0ms)←[0m  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
      ←[1m←[36mCACHE (0.0ms)←[0m  ←[1mSELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1←[0m
      ←[1m←[35mCACHE (0.0ms)←[0m  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
      ←[1m←[36mCACHE (0.0ms)←[0m  ←[1mSELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1←[0m
      ←[1m←[35mCACHE (0.0ms)←[0m  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
      Rendered projects/show.html.erb within layouts/application (46.9ms)
      Rendered layouts/_shim.html.erb (0.0ms)
      Rendered layouts/_header.html.erb (0.0ms)
      Rendered layouts/_footer.html.erb (0.0ms)
    Completed 200 OK in 94ms (Views: 93.8ms | ActiveRecord: 0.0ms)
    
    
    Started GET "/assets/custom.css?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /custom.css - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/projects.css?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /projects.css - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /application.css - 304 Not Modified (31ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /scaffolds.css - 304 Not Modified (15ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/target_langs.css?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /target_langs.css - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /jquery.js - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /jquery_ujs.js - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/projects.js?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /projects.js - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/target_langs.js?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /target_langs.js - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /application.js - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
    
    Started GET "/assets/telelingua.gif" for 127.0.0.1 at 2012-07-31 10:14:59 -0400
    Served asset /telelingua.gif - 304 Not Modified (0ms)
    [2012-07-31 10:14:59] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
		
