GithubHelp home page GithubHelp logo

Comments (3)

joshsmith avatar joshsmith commented on July 17, 2024

We'll also likely need a matcher for /:slug/:project_slug

from deprecated-code-corps-rails-api.

joshsmith avatar joshsmith commented on July 17, 2024

Also see this for more explication: http://stackoverflow.com/questions/33837394/rails-same-top-level-url-route-for-organizations-user-domain-com-user-and-domai

from deprecated-code-corps-rails-api.

begedin avatar begedin commented on July 17, 2024

The rails side seems relatively simple.

The ember side would be the complicated one, but I guess we could do a manual ajax request instead of a store.find, followed by figuring out if we got back a user or an organization, pushing it to the store and then and then either redirect to the proper route, or just set the controller model , the type of which determines if we render an organization or a user component. I'm not really sure which one is better in this case, but redirecting to a route would add the additional difficulty of making sure our URL is in the format we'd like it to be.

My question for the rails side is, how would we want to handle our slug?

Is it just a parametrized username/organization.name? Can it be editable? Do we use a gem, such as friendly_id, or just make a slug field and use find_by_slug? From what I remember from other projects, when we were using a the friendly id gem, there were some complications we had to deal with, both on the API and Ember side.

If we decide in advance the API will never allow us to fetch a user or an organization by id directly, it might be easier to not use the gem and just add a slug field and always fetch by it.

from deprecated-code-corps-rails-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.