0.0
No commit activity in last 3 years
No release in over 3 years
Verify params exist in a request before calling the desired action
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

~> 4.1.1
 Project Readme

required_params

Verify parameters exist in the request's params map before allowing the intended action to be called.

install

gem install required_params

usage

class TestController < ActionController::Base
  include RequiredParams

  required_params :foo_action, params: %i{ required_param yet_another_required_param }

  rescue_from RequiredParams::ParameterMissingError, with: :parameter_missing_handler

  def foo_action
    # do some funky controllerish stuff
  end

  protected

  def parameter_missing_handler
    # do some funky error handling stuff
  end

end