announcement-test/app/controllers/admin/announcements_controller.rb

18 lines
445 B
Ruby
Raw Normal View History

2014-04-03 03:18:02 +00:00
class Admin::AnnouncementsController < ApplicationController
def new
@announcement = Bulletin.new
end
def create
@announcement = Bulletin.new(bulletin_params)
@announcement.save
end
private
# Never trust parameters from the scary internet, only allow the white list through.
def bulletin_params
params.require(:bulletin).permit(title_translations: [:en, :zh_tw], body_translations: [:en, :zh_tw])
end
end