예제 #1
0
파일: cards.go 프로젝트: caneroj1/cardsAPI
// Index renders the index page for cards
func (c Cards) Index() revel.Result {
	if cards, err := json.Marshal(models.GetAllCards()); err == nil {
		jsonCards := string(cards[:])
		return c.Render(jsonCards)
	}

	return c.Render()
}
예제 #2
0
// Index returns all of the cards
func (c CardsAPI) Index() revel.Result {
	return c.RenderJson(models.GetAllCards())
}