<commit_before>{<img src="https://codeclimate.com/github/mattways/rails_contrib.png" />}[https://codeclimate.com/github/mattways/rails_contrib] {<img src="https://travis-ci.org/mattways/rails_contrib.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/rails_contrib] {<img src="https://gemnasium.com/mattways/rails_contrib.png" alt="Dependency Status" />}[https://gemnasium.com/mattways/rails_contrib]

= Rails Contrib

Adds contributions to the core of Rails.

= Install

Put this line in your Gemfile:
  gem 'rails_contrib'
  
Then bundle:
  $ bundle

= Sweepers

Use increment_cache_namespace if you're using memcache client and a namespace to invalidate in your sweeper:
  increment_cache_namespace :key

= Controllers

(This plugin will create an error method to force debug information on exceptions in development env)

Use not_found method to show 404.html in your controller:
  not_found

Use forbidden method to show 422.html in your controller:
  forbidden

Use redirect_with_flash to directly redirect with flash inside your controller:
  redirect_with_flash home_path, :success, 'success message'
  
Use flash_errors method to directly flash models errors inside your controller:
  flash_errors model

= Views

Use conditional_tag if you want wrap content into some tag if certain condition it's true in your views:
  - conditional_tag :h1, request.path == home_path do
    %a#logo{ :href => home_path }= Home

User active_menu? if you want to add an active class to some tag in your views:
  %li{ :class => active_menu?(some_path) }
<commit_msg>Update docs<commit_after>{<img src="https://codeclimate.com/github/mattways/rails_contrib.png" />}[https://codeclimate.com/github/mattways/rails_contrib] {<img src="https://travis-ci.org/mattways/rails_contrib.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/rails_contrib] {<img src="https://gemnasium.com/mattways/rails_contrib.png" alt="Dependency Status" />}[https://gemnasium.com/mattways/rails_contrib]

= Rails Contrib

Adds contributions to the core of Rails.

= Install

Put this line in your Gemfile:
  gem 'rails_contrib'
  
Then bundle:
  $ bundle

= Sweepers

Use increment_cache_namespace if you're using memcache client and a namespace to invalidate in your sweeper:
  increment_cache_namespace :key

= Controllers

(This plugin will create an error method to force debug information on exceptions in development env)

Use not_found method to show 404.html in your controller:
  not_found

Use forbidden method to show 422.html in your controller:
  forbidden

Use redirect_with_flash to directly redirect with flash inside your controller:
  redirect_with_flash home_path, :success, 'success message'
  
Use flash_errors method to directly flash models errors inside your controller:
  flash_errors model

= Views

Use conditional_tag if you want wrap content into some tag if certain condition it's true in your views:
  = conditional_tag :h1, request.path == home_path do
    %a#logo{ :href => home_path }= Home

User active_menu? if you want to add an active class to some tag in your views:
  %li{ :class => active_menu?(some_path) }

{'fraction_non_alphanumeric': 0.08739708676377454, 'fraction_numerical': 0.004433185560481318, 'mean_word_length': 4.9943074003795065, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5340241', 'n_tokens_mistral': 975, 'n_tokens_neox': 945, 'n_words': 329}