OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/controllers/announcements_controller.rb

31 lines
575 B

class AnnouncementsController < ApplicationController
layout 'admin'
before_filter :require_admin
def edit
@announcement = Announcement.only_one
end
def update
@announcement = Announcement.only_one
@announcement.attributes = announcement_params
if @announcement.save
flash[:notice] = t(:notice_successful_update)
end
redirect_to action: 'edit'
end
private
def default_breadcrumb
t(:label_announcement)
end
def announcement_params
params.require(:announcement).permit('text', 'show_until', 'active')
end
end