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

Use Rails path helpers for all routes #40

Merged
merged 1 commit into from
Sep 7, 2017

Commits on Sep 7, 2017

  1. Use Rails path helpers for all routes

    This enables us to:
    
    * delete the custom metaprogramming in api_helper.rb which offered a
      similar but limited implementation.
    * take advantage of the default behavior when passed an object which
      is to form a URL from the object's id, meaning the id can be omitted
      for terseness.
    * avoid having to do fuzzy matching when comparing hrefs, because
      where our methods provided only the path, Rails' gives us the full
      URL
    * avoid doing our own string concatenation for subcollection routes,
      e.g.:
      ```ruby
      # before
      "#{blueprints_url(blueprint.id)}/tags/#{tag.id}"
      # after
      api_blueprint_tag_url(nil, blueprint, tag)
    * possibly leverage some of these helpers on the production side
    imtayadeway committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    2c1bdc4 View commit details
    Browse the repository at this point in the history