route: split issue preview route to adding and editing
"No route matches" error raises in "preview_issue_path" at app/views/issues/new.html.erb:35 on Rails 3.0.11 and Rails 3.1.3 new route format. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8886 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f7618160ad
commit
84dd4ecbd4
|
@ -39,7 +39,7 @@
|
||||||
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
|
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
|
||||||
<%= submit_tag l(:button_submit) %>
|
<%= submit_tag l(:button_submit) %>
|
||||||
<%= link_to_remote l(:label_preview),
|
<%= link_to_remote l(:label_preview),
|
||||||
{ :url => preview_issue_path(:project_id => @project, :id => @issue),
|
{ :url => preview_edit_issue_path(:project_id => @project, :id => @issue),
|
||||||
:method => 'post',
|
:method => 'post',
|
||||||
:update => 'preview',
|
:update => 'preview',
|
||||||
:with => 'Form.serialize("issue-form")',
|
:with => 'Form.serialize("issue-form")',
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<%= submit_tag l(:button_create) %>
|
<%= submit_tag l(:button_create) %>
|
||||||
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||||
<%= link_to_remote l(:label_preview),
|
<%= link_to_remote l(:label_preview),
|
||||||
{ :url => preview_issue_path(:project_id => @project),
|
{ :url => preview_new_issue_path(:project_id => @project),
|
||||||
:method => 'post',
|
:method => 'post',
|
||||||
:update => 'preview',
|
:update => 'preview',
|
||||||
:with => "Form.serialize('issue-form')",
|
:with => "Form.serialize('issue-form')",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
|
<%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
|
||||||
<p><%= submit_tag l(:button_save) %>
|
<p><%= submit_tag l(:button_save) %>
|
||||||
<%= link_to_remote l(:label_preview),
|
<%= link_to_remote l(:label_preview),
|
||||||
{ :url => preview_issue_path(:project_id => @project, :id => @journal.issue),
|
{ :url => preview_edit_issue_path(:project_id => @project, :id => @journal.issue),
|
||||||
:method => 'post',
|
:method => 'post',
|
||||||
:update => "journal_#{@journal.id}_preview",
|
:update => "journal_#{@journal.id}_preview",
|
||||||
:with => "Form.serialize('journal-#{@journal.id}-form')",
|
:with => "Form.serialize('journal-#{@journal.id}-form')",
|
||||||
|
|
|
@ -44,7 +44,9 @@ ActionController::Routing::Routes.draw do |map|
|
||||||
map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
|
map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
|
||||||
:action => 'issues', :conditions => { :method => :get }
|
:action => 'issues', :conditions => { :method => :get }
|
||||||
# TODO: would look nicer as /issues/:id/preview
|
# TODO: would look nicer as /issues/:id/preview
|
||||||
map.preview_issue '/issues/preview/:id', :controller => 'previews',
|
map.preview_new_issue '/issues/preview/new/:project_id', :controller => 'previews',
|
||||||
|
:action => 'issue'
|
||||||
|
map.preview_edit_issue '/issues/preview/edit/:id', :controller => 'previews',
|
||||||
:action => 'issue'
|
:action => 'issue'
|
||||||
map.issues_context_menu '/issues/context_menu',
|
map.issues_context_menu '/issues/context_menu',
|
||||||
:controller => 'context_menus', :action => 'issues'
|
:controller => 'context_menus', :action => 'issues'
|
||||||
|
|
|
@ -21,8 +21,12 @@ class RoutingPreviewsTest < ActionController::IntegrationTest
|
||||||
def test_previews
|
def test_previews
|
||||||
["get", "post"].each do |method|
|
["get", "post"].each do |method|
|
||||||
assert_routing(
|
assert_routing(
|
||||||
{ :method => method, :path => "/issues/preview/123" },
|
{ :method => method, :path => "/issues/preview/new/123" },
|
||||||
{ :controller => 'previews', :action => 'issue', :id => '123' }
|
{ :controller => 'previews', :action => 'issue', :project_id => '123' }
|
||||||
|
)
|
||||||
|
assert_routing(
|
||||||
|
{ :method => method, :path => "/issues/preview/edit/321" },
|
||||||
|
{ :controller => 'previews', :action => 'issue', :id => '321' }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
assert_routing(
|
assert_routing(
|
||||||
|
|
Loading…
Reference in New Issue