Created
September 26, 2013 02:53
-
-
Save DevanB/6709271 to your computer and use it in GitHub Desktop.
RABL If statement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
@events = Event.upcoming.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { @events } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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