Sha256: 67a6ad5a039e3aa430e74579de7c35fba191102fe03c76862cedeaf8c29a9d33

Contents?: true

Size: 1.32 KB

Versions: 12

Compression:

Stored size: 1.32 KB

Contents

module ActionDispatch::Routing::Mapper::Resources
  # add followings to work on Edgarj::EdgarjController derived class to
  # default resource routing:
  #
  #   collection do
  #     get :clear
  #     get :csv_download
  #     get :search
  #     get :search_clear
  #     get :search_save
  #     get :search_load
  #   end
  #
  #   member do
  #     put :page_info_save
  #   end
  #
  def edgarj_resources(*symbols, &block)
    resources *symbols do
      yield if block_given?

      collection do
        get :clear
        get :csv_download
        get :search
        get :search_clear
        get :search_save
        get :search_load
        get :zip_complete
      end

      member do
        put :page_info_save
      end
    end

    self
  end

  # add followings to work on Edgarj::PopupController derived class to
  # default resource routing:
  #
  #   collection do
  #     get :clear
  #     get :csv_download
  #     get :search
  #     get :search_clear
  #     get :search_save
  #     get :search_load
  #   end
  #
  #   member do
  #     put :page_info_save
  #   end
  #
  def edgarj_popup_resources(*symbols, &block)
    resources *symbols, only: [:index] do
      yield if block_given?

      collection do
        get :search
      end

      member do
        put :page_info_save
      end
    end

    self
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
edgarj-0.01.25 lib/core_ext/resources.rb
edgarj-0.01.24 lib/core_ext/resources.rb
edgarj-0.01.22 lib/core_ext/resources.rb
edgarj-0.01.21 lib/core_ext/resources.rb
edgarj-0.01.20 lib/core_ext/resources.rb
edgarj-0.01.19 lib/core_ext/resources.rb
edgarj-0.01.18 lib/core_ext/resources.rb
edgarj-0.01.17 lib/core_ext/resources.rb
edgarj-0.01.16 lib/core_ext/resources.rb
edgarj-0.01.15 lib/core_ext/resources.rb
edgarj-0.01.13 lib/core_ext/resources.rb
edgarj-0.01.12 lib/core_ext/resources.rb