Sha256: 0a5d249d5022b86aa00eb4a633f0a8cc178e2426dbd5c3ef8cb7fe28b6ce2e93

Contents?: true

Size: 807 Bytes

Versions: 96

Compression:

Stored size: 807 Bytes

Contents

module ActiveScaffold::Actions
  module Refresh
    def self.included(base)
      base.before_filter :refresh_authorized_filter, :only => [:index, :list]
    end

    def refresh
      respond_to do |type|
        type.js do
          do_list
          render :update do |page|
            page[active_scaffold_content_id].replace_html render(:partial => 'list', :layout => false)
          end
        end
        type.html { return_to_main }
      end
    end
    
    protected

    # The default security delegates to ActiveRecordPermissions.
    # You may override the method to customize.
    def refresh_authorized?
      authorized_for?(:action => :read)
    end
    private
    def refresh_authorized_filter
      raise ActiveScaffold::ActionNotAllowed unless refresh_authorized?
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
six-updater-web-0.24.15 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.23.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb
six-updater-web-0.23.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb