diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index b5835edc309..de9946abf35 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -4,11 +4,15 @@ class CategoriesController < ApplicationController before_filter :ensure_logged_in, except: [:index, :show] before_filter :fetch_category, only: [:show, :update, :destroy] + skip_before_filter :check_xhr, only: [:index] def index - list = CategoryList.new(current_user) + @list = CategoryList.new(current_user) discourse_expires_in 1.minute - render_serialized(list, CategoryListSerializer) + respond_to do |format| + format.html { render } + format.json { render_serialized(@list, CategoryListSerializer) } + end end def show diff --git a/app/views/categories/index.html.erb b/app/views/categories/index.html.erb new file mode 100644 index 00000000000..e2b388dcbba --- /dev/null +++ b/app/views/categories/index.html.erb @@ -0,0 +1,12 @@ +<% @list.categories.each do |c| %> +
<%= t 'powered_by_html' %>
\ No newline at end of file