Skip to content

Instantly share code, notes, and snippets.

@PeteMichaud
Created June 8, 2012 00:28
Show Gist options
  • Save PeteMichaud/2892614 to your computer and use it in GitHub Desktop.
Save PeteMichaud/2892614 to your computer and use it in GitHub Desktop.
class LawyersController < ApplicationController
before_filter :authenticate_user!
before_filter :find_lawfirm
load_and_authorize_resource
layout 'application'
def index
respond_to do |format|
format.js {render json: @lawfirm.lawyers, content_type: 'text/json'}
end
end
# Keeping it dry
def find_lawfirm
@lawfirm = Lawfirm.find_by_id(params[:lawfirm_id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment