Skip to content

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

@bwillis

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions