Skip to content

Instantly share code, notes, and snippets.

@mattapayne
Created April 25, 2009 19:58
Show Gist options
  • Save mattapayne/101735 to your computer and use it in GitHub Desktop.
Save mattapayne/101735 to your computer and use it in GitHub Desktop.
#Using JamBase4R in Rails is simple. Just include it in the controller you want to use
class MyJamBaseController < ApplicationController
include JamBase4R
def search
@results = API.search(params[:search])
#You could also NOT include JamBase4R and just call it like so:
# @results = JamBase4R::API.search(params[:search])
end
end
#Using JamBase4R in something like Sinatra is also simple
get "/search" do
@results = JamBase4R::API.search(params[:search])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment