-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename /profile to /account #1407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! Two comments for your consideration re: controller / method naming, but you can take or leave that advice as you see fit. 🚿
@@ -1,11 +1,11 @@ | |||
class ProfileController < ApplicationController | |||
class AccountController < ApplicationController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rails controllers are usually plural -- thoughts on calling this AccountsController
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that seems reasonable, I'll pluralize this (and all the partials that go with it 🙈 )
@@ -1,11 +1,11 @@ | |||
class ProfileController < ApplicationController | |||
class AccountController < ApplicationController | |||
before_action :confirm_two_factor_authenticated | |||
layout 'card_wide' | |||
|
|||
def index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we called this AccountsController
, we'd probably want this to be show
rather than index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! On it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just remebered Rails' support for singular resources: WDYT of AccountController#show
:
http://guides.rubyonrails.org/routing.html#singular-resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIKE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although I think what that is saying is that you still have a plural controller but just name the route as get 'profile', to: 'users#show'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah you're right, for some reason I thought it was saying the controller would be singularly named, but I looked more closely. keeping plural controller!
@@ -0,0 +1,11 @@ | |||
require 'rails_helper' | |||
|
|||
RSpec.describe 'Redirecting Legacy Routes', type: :request do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niiiice -- will we want to remove this redirect at some point ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have an app in production now that people may have linked to...I think we want to keep this as long as possible? Maybe we can check back in 6 months and see if it was ever used?
**Why**: Matches the copy already on the page
a5cda68
to
2c16b0b
Compare
Why: Matches the copy already on the page
Open question is if we want to rename
/profile/verify
and/profile/reactivate
, for the time being I left them, and we can do that in another PR if we want.Makes these things the same: