Class: Admin::Responder
- Inherits:
-
ActionController::Responder
- Object
- ActionController::Responder
- Admin::Responder
- Defined in:
- app/controllers/admin/responder.rb
Instance Method Summary collapse
Instance Method Details
#navigation_location ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/admin/responder.rb', line 3 def follow = .delete(:action) || (controller.respond_to?(:show) ? :show : :edit) default_location = if delete? {:action => :index} elsif (follow.to_sym == :show) [:admin, resource] else [follow, :admin, resource] end l = [:location] || default_location end |
#to_html ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/admin/responder.rb', line 17 def to_html unless get? = delete? ? I18n.t("fullstack.admin.flash.success.delete") : I18n.t("fullstack.admin.flash.success.update") = delete? ? I18n.t("fullstack.admin.flash.error.delete") : I18n.t("fullstack.admin.flash.error.update") if has_errors? controller.flash[:error] = .delete(:error) || else controller.flash[:notice] = .delete(:success) || end end super end |