Sha256: cb9489118aa9dbd12c95fa195f087921ea93ec1d34b9ba160d6be7e58f890053

Contents?: true

Size: 1003 Bytes

Versions: 48

Compression:

Stored size: 1003 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)
       [:dealers, 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

48 entries across 48 versions & 1 rubygems

Version Path
fullstack-admin-0.1.42 app/controllers/admin/responder.rb
fullstack-admin-0.1.41 app/controllers/admin/responder.rb
fullstack-admin-0.1.40 app/controllers/admin/responder.rb
fullstack-admin-0.1.39 app/controllers/admin/responder.rb
fullstack-admin-0.1.38 app/controllers/admin/responder.rb
fullstack-admin-0.1.37 app/controllers/admin/responder.rb
fullstack-admin-0.1.36 app/controllers/admin/responder.rb
fullstack-admin-0.1.35 app/controllers/admin/responder.rb
fullstack-admin-0.1.34 app/controllers/admin/responder.rb
fullstack-admin-0.1.33 app/controllers/admin/responder.rb
fullstack-admin-0.1.32 app/controllers/admin/responder.rb
fullstack-admin-0.1.30 app/controllers/admin/responder.rb
fullstack-admin-0.1.29 app/controllers/admin/responder.rb
fullstack-admin-0.1.28 app/controllers/admin/responder.rb
fullstack-admin-0.1.27 app/controllers/admin/responder.rb
fullstack-admin-0.1.26 app/controllers/admin/responder.rb
fullstack-admin-0.1.25 app/controllers/admin/responder.rb
fullstack-admin-0.1.24 app/controllers/admin/responder.rb
fullstack-admin-0.1.23 app/controllers/admin/responder.rb
fullstack-admin-0.1.20 app/controllers/admin/responder.rb