Browse Source

Use dahes in URLs for user routes

pull/128/head
Paul Robert Lloyd 3 years ago
parent
commit
69f7b57c93
  1. 4
      app/views/users/account/index.html.erb
  2. 4
      config/routes.rb

4
app/views/users/account/index.html.erb

@ -10,13 +10,13 @@
<%= summary_list.row do |row|
row.key { 'Name' }
row.value { current_user.name }
row.action(visually_hidden_text: 'name', href: '/users/account/personal_details', html_attributes: { 'data-qa': 'change-name' })
row.action(visually_hidden_text: 'name', href: '/users/account/personal-details', html_attributes: { 'data-qa': 'change-name' })
end %>
<%= summary_list.row() do |row|
row.key { 'Email address' }
row.value { current_user.email }
row.action(visually_hidden_text: 'email address', href: '/users/account/personal_details', html_attributes: { 'data-qa': 'change-email' })
row.action(visually_hidden_text: 'email address', href: '/users/account/personal-details', html_attributes: { 'data-qa': 'change-email' })
end %>
<%= summary_list.row do |row|

4
config/routes.rb

@ -1,6 +1,6 @@
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
devise_for :users, controllers: { passwords: "users/passwords", sessions: "users/sessions" }, skip: [:registrations]
devise_for :users, controllers: { passwords: "users/passwords", sessions: "users/sessions" }, path_names: { sign_in: 'sign-in', sign_out: 'sign-out' }, skip: [:registrations]
devise_scope :user do
get "confirmations/reset", to: "users/passwords#reset_confirmation"
get "users/edit" => "devise/registrations#edit", :as => "edit_user_registration"
@ -19,7 +19,7 @@ Rails.application.routes.draw do
resources :users do
collection do
get "account/personal_details", to: "users/account#personal_details"
get "account/personal-details", to: "users/account#personal_details"
end
end

Loading…
Cancel
Save