0.0
No commit activity in last 3 years
No release in over 3 years
To limit the requests number of a user on an action's controller
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.2.0
 Project Readme

RailsLimiter¶ ↑

<img src=“https://travis-ci.org/idolweb/rails_limiter.png?branch=master” alt=“Build Status” />

Installation¶ ↑

You can install rails_limiter by adding this line in your Gemfile :

gem "rails_limiter", "~> 0.0.1"

And then :

bundle install

Configuration¶ ↑

To use this gem, configure RailsLimiter :

RailsLimiter::Init.configure do |config|
  config.connexion   = Redis.new
end

Use¶ ↑

In your controller :

before_filter :only => action do
  limit(
    key,
    key_max,
    expires_in,
    url
  )
end

key : your custom key key_max : the maximum requests number expires_in : the timeout url : the url where the user will be redirect if it reaches the max resquests

TODO¶ ↑

  • Use any key-value store instead of Redis only.

Copyright © 2013 Independent Distribution On Line