approval fixed

This commit is contained in:
nccu 2014-11-13 16:21:59 +08:00
parent f884511eef
commit ef5c330146
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -32,7 +32,7 @@
<li><a href="/admin/news/<%=b.id.to_s%>/edit"><%= t(:edit) %></a></li>
<li><a href="#" class="delete text-error" rel="/admin/news/<%=b.id.to_s%>"><%= t(:delete_) %></a></li>
<% if !b.approved && user_can_approve? %>
<li><a href="<%= admin_news_approve_bulletin_path(:id => b.id.to_s) %>"><%= t("news.approve") %></a></li>
<li><a href="<%= admin_news_approve_news_bulletin_path(:id => b.id.to_s) %>"><%= t("news.approve") %></a></li>
<% end %>
<% end %>
</ul>

View File

@ -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