0.0
No commit activity in last 3 years
No release in over 3 years
to allow method execution before rendering starts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.14
~> 10.0
 Project Readme

before_renders Gem Version

If Rails before_filter or after_filter doesn't enough, try before_renders. Tested in Rails 5.1.4

Installation

In your Gemfile:

gem 'before_renders'

or system wide:

$ gem install before_renders

Usage

Now you can execute methods before your rails application start to render anything. Example in application controller like below :

class ApplicationController < ActionController::Base
    before_render :set_layout

    def set_layout
        # ...
    end
end

You can also use in concerns like so:

module PrintableController
  extend ActiveSupport::Concern

  included do
    before_render :update_gst_sum, only: [:new, :show, :print_rf]
  end
end