Class: Deals::CategoriesController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/categories_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
# File 'app/controllers/categories_controller.rb', line 4

def index
  @categories = Category.all.map { |c| { 'id' => c.id, :name => c.name, :slug => c.slug} }
  respond_with(@categories)
end