{"id":25619336,"url":"https://github.com/hunterae/strong_like_bull","last_synced_at":"2025-04-14T00:41:29.862Z","repository":{"id":32747792,"uuid":"36338585","full_name":"hunterae/strong_like_bull","owner":"hunterae","description":"Makes it super simple to add strong parameters into your application by examining request parameters and recommending what feeds should be permitted.","archived":false,"fork":false,"pushed_at":"2021-01-13T21:35:21.000Z","size":9,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:52:30.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hunterae.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-27T02:50:33.000Z","updated_at":"2021-01-13T21:35:14.000Z","dependencies_parsed_at":"2022-09-12T09:43:28.257Z","dependency_job_id":null,"html_url":"https://github.com/hunterae/strong_like_bull","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterae%2Fstrong_like_bull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterae%2Fstrong_like_bull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterae%2Fstrong_like_bull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterae%2Fstrong_like_bull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunterae","download_url":"https://codeload.github.com/hunterae/strong_like_bull/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804536,"owners_count":21164125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-22T06:16:57.858Z","updated_at":"2025-04-14T00:41:29.813Z","avatar_url":"https://github.com/hunterae.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StrongLikeBull\n\nMakes it super simple to add strong parameters into your application by examining request parameters and recommending what feeds should be permitted.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'strong_like_bull'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install strong_like_bull\n\n## Usage\n\nIn application_controller.rb or a specific controller, add the following line:\n\n    include StrongLikeBull\n\nIn any controller action where you want a recommendation for the strong parameters permitted parameters based on the request parameters, add the following inside the action:\n\n    def CONTROLLER_ACTION\n      log_suggested_strong_parameters_format(PARAMETER_NAME_TO_INSPECT)\n      # perform action\n    end\n\nWhen the controller action gets hit, it will log the recommended strong params permitted params to use in the following format:\n\n    STRONG PARAMETERS: #{self.class}##{action_name} - suggested format: RECOMMENDED_PERMITTED_PARAMS\n\nIf we don't want this to be logged, we could utilize the method \"suggested_strong_parameters_format\", which will return the object representation of the strong parameters format. Like \"log_suggested_strong_parameters_format\", it also takes the PARAMETER_NAME_TO_INSPECT as a parameter.\n\n## Caution\nStrongLikeBull only serves to recommend params to permit based on what is passed in to the request. It cannot make guesses about the security of your application, or which parameters should be restricted. With this in mind, it is recommended to carefully examine the results to determine if some permitted params should be removed from the recommendation before permitting your params.\n\n## Example\n\nIf you wanted the recommended params to permit for the update action of a Posts Controller, it would like:\n\n    def update\n      log_suggested_strong_parameters_format(:post)\n      # perform update\n    end\n\nThe above example would assume the a a parameter is passed to the controller called \"post\" which contained all the fields we want to permit. The request parameters might look something like this:\n\n    { post: { name: \"My Post\", tags: [\"Personal\", \"Life\"], description: \"A description about my post\" }}\n\nIf those request parameters were passed to the update action above, we'd see the following as a result in our logs:\n\n    STRONG PARAMETERS: PostsController#update - suggested format: params.require(:post).permit [:name, {:tags=\u003e[]}, :description]\n\nUsing that suggested format, we could then modify our update action to the following:\n\n    def update\n      permitted_params = params.require(:post).permit [:name, {:tags=\u003e[]}, :description]\n      # perform update\n    end\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunterae%2Fstrong_like_bull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunterae%2Fstrong_like_bull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunterae%2Fstrong_like_bull/lists"}