TeaWithStrangers / tws-on-rails

Core Tea With Strangers application
http://teawithstrangers.com
25 stars 16 forks source link

Make Hosts and Cities use Slugs for Routing #7

Closed nickbarnwell closed 9 years ago

nickbarnwell commented 10 years ago

E.g. for a city /cities/san-francisco/ and /cities/san-francisco/ankit for a host

mehulkar commented 10 years ago

What's this for right now? https://github.com/TeaWithStrangers/tws-on-rails/blob/master/app/models/city.rb#L24-L26

nickbarnwell commented 10 years ago

Returns a record suitable for use in a query string.

The path forward I see for this is:

Hosts are more complex; the reason I used ID was that names are terrible identifiers:

ankitshah811 commented 10 years ago

I think host identifier fields should be as follows:

Hopefully Nickname = Username, but in the case of two people with same Nickname, ask them to write in their own Username (default behavior = autofill Username with what they entered in Nickname with error if there's a duplicate).

I think because hosts can change their cities (when traveling or when moving to a new home), their URLs should be /hosts/nick instead of /cities/seattle/nick.

And if we could, I'd love to make cities /san-francisco instead of /cities/san-francisco, and we could ensure that no cities have shortcodes that match another route on the website (i.e. error if someone creates city with shortcodes like:

How complex is this to accomplish?

P.S. I think shortcodes should actually be full city names with hyphens for spaces (i.e. san-francisco, seattle, and philly instead of sf, sea, phl. Some cities would have the same shortcode, like DC. I know that would make them...not-short shortcodes, but I think it's easier to follow and remember for users looking for specific pages without going through the homepage.

mehulkar commented 10 years ago

what's the purpose of a nickname?

ankitshah811 commented 10 years ago
ankitshah811 commented 10 years ago

As we're going to be increasing the host count 400% in the next 2 weeks, I want to resurface this. @nickbarnwell I know you had objections to implementation here. Could we discuss those, sort out a clear approach and make this happen before the end of this week?

nickbarnwell commented 10 years ago

Let's chat about this tonight

On Wed, Jul 16, 2014 at 4:50 PM, ankitshah811 notifications@github.com wrote:

As we're going to be increasing the host count 400% in the next 2 weeks, I want to resurface this. @nickbarnwell https://github.com/nickbarnwell I know you had objections to implementation here. Could we discuss those, sort out a clear approach and make this happen before the end of this week?

— Reply to this email directly or view it on GitHub https://github.com/TeaWithStrangers/tws-on-rails/issues/7#issuecomment-49243015 .

mehulkar commented 9 years ago

this is done.