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.2.6 app/controllers/admin/responder.rb
fullstack-admin-0.2.5 app/controllers/admin/responder.rb
fullstack-admin-0.2.4 app/controllers/admin/responder.rb
fullstack-admin-0.2.3 app/controllers/admin/responder.rb
fullstack-admin-0.2.2 app/controllers/admin/responder.rb
fullstack-admin-0.2.1 app/controllers/admin/responder.rb
fullstack-admin-0.1.56 app/controllers/admin/responder.rb
fullstack-admin-0.1.55 app/controllers/admin/responder.rb
fullstack-admin-0.1.54 app/controllers/admin/responder.rb
fullstack-admin-0.1.53 app/controllers/admin/responder.rb
fullstack-admin-0.1.52 app/controllers/admin/responder.rb
fullstack-admin-0.1.51 app/controllers/admin/responder.rb
fullstack-admin-0.1.50 app/controllers/admin/responder.rb
fullstack-admin-0.1.49 app/controllers/admin/responder.rb
fullstack-admin-0.1.48 app/controllers/admin/responder.rb
fullstack-admin-0.1.47 app/controllers/admin/responder.rb
fullstack-admin-0.1.46 app/controllers/admin/responder.rb
fullstack-admin-0.1.45 app/controllers/admin/responder.rb
fullstack-admin-0.1.44 app/controllers/admin/responder.rb
fullstack-admin-0.1.43 app/controllers/admin/responder.rb