Sitelet https://github.com/bwillis/versioncake/issues/1
Skip to content

More sugar in controller helpers for handling custom version logic? #1

Description

@bwillis

I bump an API version, but I have logic that needs to run for the new version only. There is currently a supported interface with requested_version, but we want to explore some other options that might be a little more elegant.

Example:

class UserController < ApplicationController

  def index
    if requested_version >= 5
      ...
    elsif requested_version >= 3
      ...
    elsif requested_version == 2
      ...
    else
      ...
    end
  end

end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions