Class: Admin::ActualitiesController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::ActualitiesController
- Defined in:
- app/controllers/admin/actualities_controller.rb
Instance Method Summary collapse
- #activate ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#activate ⇒ Object
46 47 48 |
# File 'app/controllers/admin/actualities_controller.rb', line 46 def activate render :text => @actuality.activate end |
#create ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/admin/actualities_controller.rb', line 36 def create if @actuality.save flash[:notice] = t('actuality.create.success').capitalize redirect_to([forgeos_cms, :admin, :actualities]) else flash[:error] = @actuality.errors.first.inspect render :action => 'new' end end |
#destroy ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/admin/actualities_controller.rb', line 50 def destroy if @actuality.destroy flash[:notice] = t('actuality.destroy.success').capitalize return redirect_to([forgeos_cms, :admin, :actualities]) if !request.xhr? else flash[:error] = t('actuality.destroy.failed').capitalize end render :nothing => true end |
#edit ⇒ Object
18 19 |
# File 'app/controllers/admin/actualities_controller.rb', line 18 def edit end |
#index ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/admin/actualities_controller.rb', line 8 def index respond_to do |format| format.html format.json do sort render :layout => false end end end |
#new ⇒ Object
32 33 34 |
# File 'app/controllers/admin/actualities_controller.rb', line 32 def new end |
#update ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/admin/actualities_controller.rb', line 21 def update if @actuality.update_attributes(params[:actuality]) flash[:notice] = t('actuality.update.success').capitalize redirect_to([forgeos_cms, :admin, :actualities]) else flash[:error] = t('actuality.update.failed').capitalize render :action => 'edit' end end |