Class: Admin::NoticesController
- Inherits:
-
AdminController
- Object
- AdminController
- Admin::NoticesController
- Defined in:
- app/controllers/admin/notices_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/admin/notices_controller.rb', line 14 def create @notice = Notice.new(params[:notice]) @notice.system_id = _sid if @notice.save redirect_to [:admin, @notice], :notice => "Successfully created Notice" else render :action => 'new' end end |
#destroy ⇒ Object
37 38 39 40 41 |
# File 'app/controllers/admin/notices_controller.rb', line 37 def destroy @notice = Notice.find_sys_id(_sid, params[:id]) @notice.destroy redirect_to admin_notices_url, :notice => "Successfully deleted Notice" end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/admin/notices_controller.rb', line 24 def edit @notice = Notice.find_sys_id(_sid, params[:id]) end |
#index ⇒ Object
2 3 4 |
# File 'app/controllers/admin/notices_controller.rb', line 2 def index @notices = Notice.sys(_sid).all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/admin/notices_controller.rb', line 10 def new @notice = Notice.new end |
#show ⇒ Object
6 7 8 |
# File 'app/controllers/admin/notices_controller.rb', line 6 def show @notice = Notice.find_sys_id(_sid, params[:id]) end |
#update ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/controllers/admin/notices_controller.rb', line 28 def update @notice = Notice.find_sys_id(_sid, params[:id]) if @notice.update_attributes(params[:notice]) redirect_to [:admin, @notice], :notice => "Successfully updated Notice" else render :action => 'edit' end end |