@@ -39,7 +39,7 | |||
|
39 | 39 | <%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %> |
|
40 | 40 | <%= submit_tag l(:button_submit) %> |
|
41 | 41 | <%= link_to_remote l(:label_preview), |
|
42 | { :url => preview_issue_path(:project_id => @project, :id => @issue), | |
|
42 | { :url => preview_edit_issue_path(:project_id => @project, :id => @issue), | |
|
43 | 43 | :method => 'post', |
|
44 | 44 | :update => 'preview', |
|
45 | 45 | :with => 'Form.serialize("issue-form")', |
@@ -32,7 +32,7 | |||
|
32 | 32 | <%= submit_tag l(:button_create) %> |
|
33 | 33 | <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> |
|
34 | 34 | <%= link_to_remote l(:label_preview), |
|
35 | { :url => preview_issue_path(:project_id => @project), | |
|
35 | { :url => preview_new_issue_path(:project_id => @project), | |
|
36 | 36 | :method => 'post', |
|
37 | 37 | :update => 'preview', |
|
38 | 38 | :with => "Form.serialize('issue-form')", |
@@ -7,7 +7,7 | |||
|
7 | 7 | <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %> |
|
8 | 8 | <p><%= submit_tag l(:button_save) %> |
|
9 | 9 | <%= link_to_remote l(:label_preview), |
|
10 | { :url => preview_issue_path(:project_id => @project, :id => @journal.issue), | |
|
10 | { :url => preview_edit_issue_path(:project_id => @project, :id => @journal.issue), | |
|
11 | 11 | :method => 'post', |
|
12 | 12 | :update => "journal_#{@journal.id}_preview", |
|
13 | 13 | :with => "Form.serialize('journal-#{@journal.id}-form')", |
@@ -44,8 +44,10 ActionController::Routing::Routes.draw do |map| | |||
|
44 | 44 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', |
|
45 | 45 | :action => 'issues', :conditions => { :method => :get } |
|
46 | 46 | # TODO: would look nicer as /issues/:id/preview |
|
47 | map.preview_issue '/issues/preview/:id', :controller => 'previews', | |
|
48 | :action => 'issue' | |
|
47 | map.preview_new_issue '/issues/preview/new/:project_id', :controller => 'previews', | |
|
48 | :action => 'issue' | |
|
49 | map.preview_edit_issue '/issues/preview/edit/:id', :controller => 'previews', | |
|
50 | :action => 'issue' | |
|
49 | 51 | map.issues_context_menu '/issues/context_menu', |
|
50 | 52 | :controller => 'context_menus', :action => 'issues' |
|
51 | 53 |
@@ -21,8 +21,12 class RoutingPreviewsTest < ActionController::IntegrationTest | |||
|
21 | 21 | def test_previews |
|
22 | 22 | ["get", "post"].each do |method| |
|
23 | 23 | assert_routing( |
|
24 | { :method => method, :path => "/issues/preview/123" }, | |
|
25 | { :controller => 'previews', :action => 'issue', :id => '123' } | |
|
24 | { :method => method, :path => "/issues/preview/new/123" }, | |
|
25 | { :controller => 'previews', :action => 'issue', :project_id => '123' } | |
|
26 | ) | |
|
27 | assert_routing( | |
|
28 | { :method => method, :path => "/issues/preview/edit/321" }, | |
|
29 | { :controller => 'previews', :action => 'issue', :id => '321' } | |
|
26 | 30 | ) |
|
27 | 31 | end |
|
28 | 32 | assert_routing( |
General Comments 0
You need to be logged in to leave comments.
Login now