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 6682905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:45:35+00:00 2026-05-26T04:45:35+00:00

Update: I found the solution, look in the bottom of this page… I’ve got

  • 0

Update: I found the solution, look in the bottom of this page…

I’ve got a Node.js, Express, MongoDB, Mongoose project written in CoffeScript and I can create and read data, but I can’t update.

This is what my code looks like;

app.js

 # update
 app.put "/admin/:id.:format?", (req, res) ->
    Content.findById req.body.content.id, (err, c) ->
        c.title = req.body.content.title
        c.body = req.body.content.body
        c.save (err) ->
            switch req.params.format
                when "json"
                    res.send c.__doc
                else
                    res.redirect "/admin"

edit.jade

h2 Edit Content
form(method='post', action='/admin/' + c.id)
  input(name='content[id]', value=c.id, type='hidden')
  input(name='_method', value='PUT', type='hidden')
div
  label Title:
    input(name='content[title]', value=c.title || '')
div
  label Body:
    textarea(name='content[body]')=c.body || ''
div
  input(type='submit', value='Save')

And this is what my console says

127.0.0.1 - - [Thu, 13 Oct 2011 21:39:55 GMT] "POST /admin/4e96ec17fd7da7cb18000001 HTTP/1.1" 404 - "http://localhost:1234/admin/4e96ec17fd7da7cb18000001/edit" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.83 Safari/535.2"

And this is what my browser tells me

Cannot POST /admin/4e96ec17fd7da7cb18000001
  • 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-05-26T04:45:36+00:00Added an answer on May 26, 2026 at 4:45 am

    I found the solution on http://expressjs.com/guide.html:

    “When using methods such as PUT with a form, we can utilize a hidden input named _method, which can be used to alter the HTTP method. To do so we first need the methodOverride middleware, which should be placed below bodyParser so that it can utilize it’s req.body containing the form values.”

    app.use express.bodyParser()
    app.use express.methodOverride()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update Solution Found See Bottom of post if interested Seems simple enough and for
Possible Duplicate: SQL ORDER BY total within GROUP BY UPDATE: I've found my solution,
using Microsoft.SqlServer.Management.SqlStudio.Explorer; unable to find this pls assist [update] found the dll's in this
I found this article about how to insert, update and delete using linq pad
I found some problem. When i running apc_store and more times update a page
Update: I still haven't found any easy and good enough solution for mailinglists. We
I never found an optimal solution for this problem so I am hoping that
UPDATE: I actually found the solution myself, see below. In R I want to
Update: found a solution, see below. I'm trying to get a clicked tile div
Update : I found almost exact similar question , yet it has slightly different

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.