diff --git a/app/views/messages/_message_summary.html.erb b/app/views/messages/_message_summary.html.erb
index b31b5c526..6ed41a0e0 100644
--- a/app/views/messages/_message_summary.html.erb
+++ b/app/views/messages/_message_summary.html.erb
@@ -2,7 +2,7 @@
<%= link_to h(message_summary.sender.display_name), user_path(message_summary.sender) %> |
<%= link_to h(message_summary.title), message_path(message_summary) %> |
<%= l message_summary.sent_on, :format => :friendly %> |
- <%= button_to t('.unread_button'), mark_message_path(message_summary, :mark => 'unread'), { :remote => true } %> |
- <%= button_to t('.read_button'), mark_message_path(message_summary, :mark => 'read'), { :remote => true } %> |
+ <%= button_to t('.unread_button'), message_mark_path(message_summary, :mark => 'unread'), { :remote => true } %> |
+ <%= button_to t('.read_button'), message_mark_path(message_summary, :mark => 'read'), { :remote => true } %> |
<%= button_to t('.destroy_button'), message_path(message_summary, :referer => request.fullpath), { :method => :delete, :remote => true } %> |
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
index 90744466b..6ea46fcc6 100644
--- a/app/views/messages/show.html.erb
+++ b/app/views/messages/show.html.erb
@@ -15,7 +15,7 @@
<%= button_to t('.reply_button'), reply_message_path(@message), :class => 'reply-button' %>
- <%= button_to t('.unread_button'), mark_message_path(@message, :mark => 'unread'), :class => 'mark-unread-button' %>
+ <%= button_to t('.unread_button'), message_mark_path(@message, :mark => 'unread'), :class => 'mark-unread-button' %>
<%= button_to t('.destroy_button'), message_path(@message), :method => 'delete', :class => 'destroy-button' %>
<% else %>
diff --git a/config/routes.rb b/config/routes.rb
index db6b9989a..f3b7fefe4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -265,6 +265,7 @@ OpenStreetMap::Application.routes.draw do
# messages
resources :messages, :only => [:create, :show, :destroy] do
+ post :mark
collection do
get :inbox
get :outbox
@@ -274,7 +275,7 @@ OpenStreetMap::Application.routes.draw do
get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox")
get "/message/new/:display_name" => "messages#new", :as => "new_message"
get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}")
- post "/message/mark/:message_id" => "messages#mark", :as => "mark_message"
+ post "/message/mark/:message_id" => "messages#mark" # remove after deployment
match "/message/reply/:message_id" => "messages#reply", :via => [:get, :post], :as => "reply_message"
# oauth admin pages (i.e: for setting up new clients, etc...)
diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb
index a5043a3f3..e3756f042 100644
--- a/test/controllers/messages_controller_test.rb
+++ b/test/controllers/messages_controller_test.rb
@@ -25,7 +25,7 @@ class MessagesControllerTest < ActionController::TestCase
{ :controller => "messages", :action => "show", :id => "1" }
)
assert_routing(
- { :path => "/message/mark/1", :method => :post },
+ { :path => "/messages/1/mark", :method => :post },
{ :controller => "messages", :action => "mark", :message_id => "1" }
)
assert_routing(