Refactor: Start to extract IssuesController#edit into #update (REST).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3480 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-02-24 17:21:41 +00:00
parent 6ed9734cb9
commit d581510af6
4 changed files with 37 additions and 29 deletions
+9 -2
View File
@@ -19,7 +19,7 @@ class IssuesController < ApplicationController
menu_item :new_issue, :only => :new
default_search_scope :issues
before_filter :find_issue, :only => [:show, :edit, :reply]
before_filter :find_issue, :only => [:show, :edit, :update, :reply]
before_filter :find_issues, :only => [:bulk_edit, :move, :destroy]
before_filter :find_project, :only => [:new, :update_form, :preview]
before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :context_menu]
@@ -226,7 +226,7 @@ class IssuesController < ApplicationController
end
# failure
respond_to do |format|
format.html { }
format.html { render :action => 'edit' }
format.xml { render :xml => @issue.errors, :status => :unprocessable_entity }
end
end
@@ -237,6 +237,13 @@ class IssuesController < ApplicationController
attachments.each(&:destroy)
end
#--
# Start converting to the Rails REST controllers
#++
def update
edit
end
def reply
journal = Journal.find(params[:journal_id]) if params[:journal_id]
if journal
+2 -1
View File
@@ -1,7 +1,8 @@
<% labelled_tabular_form_for :issue, @issue,
:url => {:action => 'edit', :id => @issue},
:url => {:action => 'update', :id => @issue},
:html => {:id => 'issue-form',
:class => nil,
:method => :put,
:multipart => true} do |f| %>
<%= error_messages_for 'issue' %>
<%= error_messages_for 'time_entry' %>