Example #1
0
// 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()
}
Example #2
0
// Index returns all of the cards
func (c CardsAPI) Index() revel.Result {
	return c.RenderJson(models.GetAllCards())
}