Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8320329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:37:14+00:00 2026-06-08T22:37:14+00:00

I tried to update a post and it tells me Target language was successfully

  • 0

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 POST "/projects/5/target_langs/14" for 127.0.0.1 at 2012-07-31 10:14:58 -0400
Processing by TargetLangsController#update as HTML
  Parameters: {"authenticity_token"=>"kTkBzwah/MylU9N96i+s5lu99PskX28XF0eK1THsHLY=", "project_id"=>"5", "id"=>"14"}
  ←[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 AND "target_langs"."id"
= ? LIMIT 1←[0m  [["id", "14"]]
  ←[1m←[35m (0.0ms)←[0m  begin transaction
  ←[1m←[36m (0.0ms)←[0m  ←[1mcommit transaction←[0m
Redirected to http://localhost:3000/projects/5
Completed 302 Found in 125ms (ActiveRecord: 0.0ms)
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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:37:15+00:00Added an answer on June 8, 2026 at 10:37 pm

    I think there’s a simple problem here.

    You have two links, one to :delete (which I guess works) and the other to :update (which doesnt work)

    Simply put, in HTML an <a> tag (which is what link_to returns) will not submit a form.

    When you click “Update” in your example, the only parameter you are sending is the id.

    Instead you should say submit_tag("Update")

    This will submit the form, and all should be well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to update an fullcalendar event with updateEvent but only the first time
i am trying to update record with nHibernate. I tried several solutions, but none
Is it possible to update first row and with WHERE clause. I Tried: UPDATE
I tried to update some part of a matrix, I got the following error
Our proxy went down and I tried to update dependencies with Maven while it
Hey, I've tried to update jQuery to its latest version on a system I'm
I downloaded a pre-release version of the iPhone SDK and tried to update one
One update: I tried using the SummaryRow on the datagrid for its basic functionalities
UPDATE: I tried implementing the method specified by Peter and am getting incorrect shadowing.
UPDATE I tried using the internal wordpress rewrite. What I have to do is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.