Project

General

Profile

Defect #2707 » 0001-Fixed-the-TimeLog-form-it-was-always-posting-to-the.patch

Alternative fix - Eric Davis, 2009-02-10 18:37

View differences:

app/views/timelog/edit.rhtml
1 1
<h2><%= l(:label_spent_time) %></h2>
2 2

  
3
<% labelled_tabular_form_for :time_entry, @time_entry, :url => {:action => 'edit', :id => @time_entry, :project_id => @time_entry.project} do |f| %>
3
<% labelled_tabular_form_for :time_entry, @time_entry, :url => {:action => 'edit', :project_id => @time_entry.project}, :method => :post do |f| %>
4 4
<%= error_messages_for 'time_entry' %>
5 5
<%= back_url_hidden_field_tag %>
6 6

  
config/routes.rb
20 20
  map.connect 'help/:ctrl/:page', :controller => 'help'
21 21
  
22 22
  map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
23
  map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
23
  map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog', :method => :get
24 24
  map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
25 25
  
26 26
  map.with_options :controller => 'timelog' do |timelog|
test/functional/timelog_controller_test.rb
37 37
    )
38 38
    assert_routing(
39 39
      {:method => :get, :path => '/projects/ecookbook/time_entries/new'},
40
      :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook'
40
      :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook', :method => :get
41 41
    )
42 42
    assert_routing(
43 43
      {:method => :get, :path => '/projects/ecookbook/issues/567/time_entries/new'},
(2-2/2)