Skip to content
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

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Conversation

zachmargolis
Copy link
Contributor

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:

f367f4ba-2b4f-11e7-976f-087d8049cf6d-1

Copy link
Contributor

@jessieay jessieay left a 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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! On it

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIKE

Copy link
Contributor

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' ?

Copy link
Contributor Author

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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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
@zachmargolis zachmargolis merged commit 35919ba into master Apr 28, 2017
@zachmargolis zachmargolis deleted the margolis-rename-to-account branch April 28, 2017 22:46
@aduth aduth mentioned this pull request Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants