summaryrefslogtreecommitdiffstats
path: root/app/controllers/messages_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-15 19:14:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-15 19:14:23 +0000
commit471f631dbdaa7f939f1023785708af146324701e (patch)
tree5b61b9a748d2411b4e49cc42c27d8288dbcbae37 /app/controllers/messages_controller.rb
parent54d2b07bffdb34cd8e2182ebda111a17df5a5530 (diff)
downloadredmine-471f631dbdaa7f939f1023785708af146324701e.tar.gz
redmine-471f631dbdaa7f939f1023785708af146324701e.zip
Use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10003 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/messages_controller.rb')
-rw-r--r--app/controllers/messages_controller.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index cb65df920..cc53c0d78 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -59,7 +59,7 @@ class MessagesController < ApplicationController
if @message.save
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
render_attachment_warning_if_needed(@message)
- redirect_to :action => 'show', :id => @message
+ redirect_to board_message_path(@board, @message)
end
end
end
@@ -76,7 +76,7 @@ class MessagesController < ApplicationController
attachments = Attachment.attach_files(@reply, params[:attachments])
render_attachment_warning_if_needed(@reply)
end
- redirect_to :action => 'show', :id => @topic, :r => @reply
+ redirect_to board_message_path(@board, @topic, :r => @reply)
end
# Edit a message
@@ -88,7 +88,7 @@ class MessagesController < ApplicationController
render_attachment_warning_if_needed(@message)
flash[:notice] = l(:notice_successful_update)
@message.reload
- redirect_to :action => 'show', :board_id => @message.board, :id => @message.root, :r => (@message.parent_id && @message.id)
+ redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id))
end
end
@@ -97,9 +97,11 @@ class MessagesController < ApplicationController
(render_403; return false) unless @message.destroyable_by?(User.current)
r = @message.to_param
@message.destroy
- redirect_to @message.parent.nil? ?
- { :controller => 'boards', :action => 'show', :project_id => @project, :id => @board } :
- { :action => 'show', :id => @message.parent, :r => r }
+ if @message.parent
+ redirect_to board_message_path(@board, @message.parent, :r => r)
+ else
+ redirect_to project_board_path(@project, @board)
+ end
end
def quote