No release in over 3 years
Pagination for Flame application with Formalism forms.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 0.1.0
~> 0.2.0
~> 3.9
~> 0.87.0
~> 0.18.0
~> 0.10.0

Runtime

>= 4, < 6
 Project Readme

Flame Pagination

Cirrus CI - Base Branch Build Status Codecov branch Code Climate Depfu Inline docs license Gem

Pagination for Flame application with Formalism forms.

Installation

Add this line to your application's Gemfile:

gem 'flame-pagination'

And then execute:

bundle install

Or install it yourself as:

gem install flame-pagination

Usage

Recommended to use only as dependency of formalism-model_forms.

You'll still have to include Flame::Pagination::ForController into your model controller.

Details below:

require 'flame-pagination'

module MyProject
  ## Already in `formalism-model_forms`
  module Forms
    module Model
      ## Base form for model listing
      class List < Base
        include Flame::Pagination::ForForms
      end
    end

    module User
      class List < Model::List
      end
    end
  end

  ## Have to be set manually, maybe in some common `ModelController`
  module Controlelrs
    module UsersController
      extend Flame::Controller::Actions
      include Flame::Pagination::ForController

      def index
        @form = Forms::User::List.new(params[:user])

        paginate! @form

        @users = if (form_outcome = @form.run).success?
          form_outcome.result
        end

        view :index
      end
    end
  end
end

Development

After checking out the repo, run bundle install to install dependencies.

Then, run toys rspec to run the tests.

To install this gem onto your local machine, run toys gem install.

To release a new version, run toys gem release %version%. See how it works here.

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.