added index page
This commit is contained in:
parent
594c6b6d99
commit
1cc572e631
|
@ -8,6 +8,10 @@ class Admin::AnnouncementsController < ApplicationController
|
||||||
@announcement.save
|
@announcement.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@announcements = Bulletin.all
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<% @announcements.each do |a|%>
|
||||||
|
<%= a.title %>
|
||||||
|
<% end %>
|
|
@ -1,7 +1,8 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
scope "(:locale)", locale: /en|zh_tw/ do
|
locales = Site.find_by(site_active: true).in_use_locales
|
||||||
|
|
||||||
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :announcements
|
resources :announcements
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,6 +8,7 @@ module Announcement
|
||||||
|
|
||||||
side_bar do
|
side_bar do
|
||||||
head_label_i18n 'announcement.announcement', icon_class: "icons-megaphone"
|
head_label_i18n 'announcement.announcement', icon_class: "icons-megaphone"
|
||||||
|
active_for_controllers ({:private=>['announcements']})
|
||||||
head_link_path "admin_announcements_path"
|
head_link_path "admin_announcements_path"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue