Skip to content

Instantly share code, notes, and snippets.

@andyjeffries
Created May 3, 2014 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyjeffries/414e0d6e107e0c735da5 to your computer and use it in GitHub Desktop.
Save andyjeffries/414e0d6e107e0c735da5 to your computer and use it in GitHub Desktop.
ARC before_filter example for David Tolsma
class User < ActiveRestClient::Base
before_filter do |name, request|
request.headers["Authorization"] = request.get_params[:authorization]
end
get :find, "/users/:id"
end
class UsersController < ApplicationController
def show
User.find(id: current_user.id, authorization: current_user.authorization)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment