##// END OF EJS Templates
Named routed for RSS/API keys (#20997)....
Jean-Philippe Lang -
r14295:486a4dfbc82a
parent child
Show More
@@ -15,13 +15,13
15 <% else %>
15 <% else %>
16 <%= l(:label_missing_feeds_access_key) %>
16 <%= l(:label_missing_feeds_access_key) %>
17 <% end %>
17 <% end %>
18 (<%= link_to l(:button_reset), {:action => 'reset_rss_key'}, :method => :post %>)
18 (<%= link_to l(:button_reset), my_rss_key_path, :method => :post %>)
19 </p>
19 </p>
20
20
21 <% if Setting.rest_api_enabled? %>
21 <% if Setting.rest_api_enabled? %>
22 <h4><%= l(:label_api_access_key) %></h4>
22 <h4><%= l(:label_api_access_key) %></h4>
23 <div>
23 <div>
24 <%= link_to l(:button_show), {:action => 'show_api_key'}, :remote => true %>
24 <%= link_to l(:button_show), my_api_key_path, :remote => true %>
25 <pre id='api-access-key' class='autoscroll'></pre>
25 <pre id='api-access-key' class='autoscroll'></pre>
26 </div>
26 </div>
27 <%= javascript_tag("$('#api-access-key').hide();") %>
27 <%= javascript_tag("$('#api-access-key').hide();") %>
@@ -31,6 +31,6
31 <% else %>
31 <% else %>
32 <%= l(:label_missing_api_access_key) %>
32 <%= l(:label_missing_api_access_key) %>
33 <% end %>
33 <% end %>
34 (<%= link_to l(:button_reset), {:action => 'reset_api_key'}, :method => :post %>)
34 (<%= link_to l(:button_reset), my_api_key_path, :method => :post %>)
35 </p>
35 </p>
36 <% end %>
36 <% end %>
@@ -72,9 +72,9 Rails.application.routes.draw do
72 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
72 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
73 match 'my/page', :controller => 'my', :action => 'page', :via => :get
73 match 'my/page', :controller => 'my', :action => 'page', :via => :get
74 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
74 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
75 match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
75 get 'my/api_key', :to => 'my#show_api_key', :as => 'my_api_key'
76 match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
76 post 'my/api_key', :to => 'my#reset_api_key'
77 match 'my/api_key', :controller => 'my', :action => 'show_api_key', :via => :get
77 post 'my/rss_key', :to => 'my#reset_rss_key', :as => 'my_rss_key'
78 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
78 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
79 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
79 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
80 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
80 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
@@ -28,9 +28,9 class RoutingMyTest < Redmine::RoutingTest
28 should_route 'GET /my/page' => 'my#page'
28 should_route 'GET /my/page' => 'my#page'
29 should_route 'GET /my' => 'my#index'
29 should_route 'GET /my' => 'my#index'
30
30
31 should_route 'POST /my/reset_rss_key' => 'my#reset_rss_key'
32 should_route 'POST /my/reset_api_key' => 'my#reset_api_key'
33 should_route 'GET /my/api_key' => 'my#show_api_key'
31 should_route 'GET /my/api_key' => 'my#show_api_key'
32 should_route 'POST /my/api_key' => 'my#reset_api_key'
33 should_route 'POST /my/rss_key' => 'my#reset_rss_key'
34
34
35 should_route 'GET /my/password' => 'my#password'
35 should_route 'GET /my/password' => 'my#password'
36 should_route 'POST /my/password' => 'my#password'
36 should_route 'POST /my/password' => 'my#password'
General Comments 0
You need to be logged in to leave comments. Login now