<%= form_for @event, :url => { :controller => 'events', :action => 'update', :id => @event} do |f| %>
<%= f.label :name, "Name" %>
<%= f.text_field :name %>
<%= f.label :description, "Description" %>
<%= f.text_area :description %>
<%= f.submit "Update" %> <% end %> ==================HTML 代码================
<form accept-charset="UTF-8" action="/events/update/1" class="edit_event" id="edit_event_1" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="H3mxVhDPQ6StwbGsOcGrNTMj2qrqxXKh2fPHqJahnD0=" /></div>
<label for="event_name">Name</label>
<input id="event_name" name="event[name]" size="30" type="text" value="张三的" /> <br>
<label for="event_description">Description</label>
<textarea cols="40" id="event_description" name="event[description]" rows="20">
爱打球</textarea> <br>
<input name="commit" type="submit" value="Update" />
</form>
这个:url 中的 id 是不是代表这个对象本身,还是这个对象的 id 属性?