diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 570298b2..a781df0d 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -2,5 +2,6 @@ class NotificationsController < ApplicationController before_filter :authenticate_user! def index + @type = params[:type] end end diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 83cdd889..12282da0 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -1 +1 @@ -= nav_entry "Notifications", "/notifications/index", badge: notification_count \ No newline at end of file += nav_entry "Notifications", notifications_path, badge: notification_count \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 0f0be3d7..6e268567 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,8 +7,6 @@ Rails.application.routes.draw do mount Sidekiq::Web, at: "/sidekiq" end - get 'notifications/index' - root 'static#index' match '/about', to: 'static#about', via: 'get' @@ -58,6 +56,8 @@ Rails.application.routes.draw do match '/public', to: 'public#index', via: :get, as: :public_timeline + match '/notifications(/:type)', to: 'notifications#index', via: :get, as: :notifications, defaults: {type: 'all'} + match '/inbox', to: 'inbox#show', via: 'get' match '/user/:username(/p/:page)', to: 'user#show', via: 'get', defaults: {page: 1}