From ef5c3301464be58a7e2fd01773caff92f6f633c6 Mon Sep 17 00:00:00 2001 From: nccu Date: Thu, 13 Nov 2014 16:21:59 +0800 Subject: [PATCH] approval fixed --- app/controllers/admin/news_controller.rb | 2 +- app/views/admin/news/_index.html.erb | 2 +- config/routes.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/news_controller.rb b/app/controllers/admin/news_controller.rb index 075516e..8360c1d 100644 --- a/app/controllers/admin/news_controller.rb +++ b/app/controllers/admin/news_controller.rb @@ -59,7 +59,7 @@ class Admin::NewsController < OrbitAdminController news_bulletin = NewsBulletin.find(id) news_bulletin.approved = true news_bulletin.save - redirect_to admin_news_path + redirect_to "/admin/news" end def edit diff --git a/app/views/admin/news/_index.html.erb b/app/views/admin/news/_index.html.erb index b14e829..466f67b 100644 --- a/app/views/admin/news/_index.html.erb +++ b/app/views/admin/news/_index.html.erb @@ -32,7 +32,7 @@
  • <%= t(:edit) %>
  • <%= t(:delete_) %>
  • <% if !b.approved && user_can_approve? %> -
  • <%= t("news.approve") %>
  • +
  • <%= t("news.approve") %>
  • <% end %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 99fbf19..1f30f06 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,7 @@ Rails.application.routes.draw do namespace :admin do post 'news/preview', to: 'news#preview' get 'news/destroy_preview/:slug_title-:uid', to: 'news#destroy_preview' - get 'news/approve_bulletin', to: 'news#approve_bulletin' + get 'news/approve_news_bulletin', to: 'news#approve_news_bulletin' get 'news_admins/get_departments' => "news_admins#get_departments" resources :news resources :news_admins