Skip to content

Instantly share code, notes, and snippets.

@DevanB
Created September 26, 2013 02:53
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 DevanB/6709271 to your computer and use it in GitHub Desktop.
Save DevanB/6709271 to your computer and use it in GitHub Desktop.
RABL If statement
def index
@events = Event.upcoming.all
respond_to do |format|
format.html # index.html.erb
format.json { @events }
end
end
collection @events
attributes :title, :date, :time, :venue, :description, :price, :address, :featured, :catId, :link, :latitude, :longitude
node(:imageUrl){|events| events.image.url(:main)}
node(:imageThumbUrl){|events| events.image.url(:thumb)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment