added index page

This commit is contained in:
Saurabh Bhatia 2014-04-10 11:52:59 +08:00
parent 594c6b6d99
commit 1cc572e631
4 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,10 @@ class Admin::AnnouncementsController < ApplicationController
@announcement.save
end
def index
@announcements = Bulletin.all
end
private
# Never trust parameters from the scary internet, only allow the white list through.

View File

@ -0,0 +1,3 @@
<% @announcements.each do |a|%>
<%= a.title %>
<% end %>

View File

@ -1,7 +1,8 @@
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
resources :announcements
end

View File

@ -8,6 +8,7 @@ module Announcement
side_bar do
head_label_i18n 'announcement.announcement', icon_class: "icons-megaphone"
active_for_controllers ({:private=>['announcements']})
head_link_path "admin_announcements_path"
end
end