Skip to content

Instantly share code, notes, and snippets.

@PeteMichaud
Created June 5, 2012 16:13
Show Gist options
  • Save PeteMichaud/2876001 to your computer and use it in GitHub Desktop.
Save PeteMichaud/2876001 to your computer and use it in GitHub Desktop.
def show
begin
@company = Company.find params[:id].to_i
rescue ActiveRecord::RecordNotFound
#do nothing
end
if @company.present?
@vendors = @company.vendors
end
respond_to do |format|
format.js {render json: @vendors, content_type: 'text/json'}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment