Sha256: 8cd7f14209733709840f42464fadfbcd03ea5a4cdd588f109975777d263e752b

Contents?: true

Size: 1001 Bytes

Versions: 19

Compression:

Stored size: 1001 Bytes

Contents

class Admin::Responder < ActionController::Responder
  
   def navigation_location
     follow = options.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 = options[:location] || default_location
   end
   
   def to_html
     unless get?
       default_success_message = delete? ? I18n.t("fullstack.admin.flash.success.delete") : I18n.t("fullstack.admin.flash.success.update")
       default_error_message   = delete? ? I18n.t("fullstack.admin.flash.error.delete")   : I18n.t("fullstack.admin.flash.error.update")
       
       if has_errors?
         controller.flash[:error] = options.delete(:error)  || default_error_message 
       else
         controller.flash[:notice] = options.delete(:success) || default_success_message 
       end      
     end
     super
   end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
fullstack-admin-0.2.26 app/controllers/admin/responder.rb
fullstack-admin-0.2.25 app/controllers/admin/responder.rb
fullstack-admin-0.2.24 app/controllers/admin/responder.rb
fullstack-admin-0.2.23 app/controllers/admin/responder.rb
fullstack-admin-0.2.22 app/controllers/admin/responder.rb
fullstack-admin-0.2.21 app/controllers/admin/responder.rb
fullstack-admin-0.2.20 app/controllers/admin/responder.rb
fullstack-admin-0.2.19 app/controllers/admin/responder.rb
fullstack-admin-0.2.18 app/controllers/admin/responder.rb
fullstack-admin-0.2.17 app/controllers/admin/responder.rb
fullstack-admin-0.2.16 app/controllers/admin/responder.rb
fullstack-admin-0.2.15 app/controllers/admin/responder.rb
fullstack-admin-0.2.14 app/controllers/admin/responder.rb
fullstack-admin-0.2.13 app/controllers/admin/responder.rb
fullstack-admin-0.2.12 app/controllers/admin/responder.rb
fullstack-admin-0.2.11 app/controllers/admin/responder.rb
fullstack-admin-0.2.9 app/controllers/admin/responder.rb
fullstack-admin-0.2.8 app/controllers/admin/responder.rb
fullstack-admin-0.2.7 app/controllers/admin/responder.rb