From de7222ab8a594602be69391cd852b4ecb375a090 Mon Sep 17 00:00:00 2001 From: Dani Macho Date: Sun, 19 Oct 2014 14:01:52 +0200 Subject: [PATCH] Added new controller and view to show tags grouped alphabetically --- app/controllers/tags_controller.rb | 6 ++++++ config/routes.rb | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 872b347..610d270 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -7,4 +7,10 @@ class TagsController < ApplicationController respond_with @all_tags end + + def alpha_grouped_index + + @alpha_tags = Post::alphabetical_grouped_tags + respond_with @alpha_tags + end end diff --git a/config/routes.rb b/config/routes.rb index b06441a..dc1855e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,7 +15,7 @@ Timeoverflow::Application.routes.draw do resources :offers, concerns: :joinable do collection do get :dashboard - end + end end resources :inquiries, concerns: :joinable @@ -52,6 +52,10 @@ Timeoverflow::Application.routes.draw do post :accept end - resource :tags, only: [:index] + resource :tags, only: [:index] do + collection do + get "alpha_grouped_index" + end + end end