Class: Admin::WidgetFaqsController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::WidgetFaqsController
- Defined in:
- app/controllers/admin/widget_faqs_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #duplicate ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 11 def create if @widget_faq.save flash[:notice] = t('destination.create.success').capitalize redirect_to([forgeos_cms, :admin, :widgets]) else flash[:error] = @widget_faq.errors.first.inspect render :action => 'new' end end |
#destroy ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 43 def destroy if @widget_faq.destroy flash[:notice] = I18n.t('widget.destroy.success').capitalize else flash[:error] = @widget_faq.errors if @widget_faq flash[:error] = I18n.t('widget.destroy.failed').capitalize end render :nothing => true end |
#duplicate ⇒ Object
27 28 29 30 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 27 def duplicate @widget_faq = @widget_faq.clone render :action => 'new' end |
#edit ⇒ Object
24 25 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 24 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 7 def index return redirect_to([forgeos_cms, :admin, :widgets]) end |
#new ⇒ Object
21 22 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 21 def new end |
#update ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/admin/widget_faqs_controller.rb', line 33 def update if @widget_faq.update_attributes(params[:widget_faq]) flash[:notice] = t('widget_faq.update.success').capitalize redirect_to([forgeos_cms, :admin, :widgets]) else flash[:error] = t('widget_faq.update.failed').capitalize render :action => 'edit' end end |