title: Sinatra HTTP 'PUT' method
body: <p>Something's wrong with the PUT action here, the form gets processed but the updated field is not being saved.</p>
  
  <p>I've did what Sinatra users are doing, by adding in "_method" for Sinatra to recognise that's its a HTTP PUT action. Could anyone spot any mistake here?</p>
  
  <pre><code># edit
  get '/entries/*/:id/edit' do
    @entry = Entries.get(params[:id])
    @title = "edit"
    erb :edit, :layout =&gt; :edit_layout
  end
  
  # update
  put '/entries/:id' do
    @entry = Entries.get(params[:id])
    if @entry.save
      redirect "/entries/id=#{@entry.id}"
    else
      redirect "/enewsletters"
    end
  end
  
  &lt;!-- Edit form --&gt;
  &lt;form action="/enewsletters/edit/&lt;%= @entry.id %&gt;" method="post"&gt;
    &lt;input name="_method" value="put" type="hidden"/&gt;
    &lt;p&gt;
      &lt;label&gt;Content&lt;/label&gt;&lt;br/&gt;
      &lt;input type="text" name="entry[title]" value="&lt;%= @enew.title %&gt;"&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;input type="submit" name="commit" value="update"&gt;
    &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>