How to Automate Copyright Notice Updates in RubyonRails

Suppose you want to automate the update process in a website written in RubyonRails.Here is one way to do it with a simple layout helper function. In helpers/layout_helper.rb: def copyright_notice_year_range(start_year) # In case the input was not a number (nil.to_i will return a 0) start_year = start_year.to_i # Get the current year from the system […]

ActionView::Template::Error (undefined local variable or method `bootstrap_flash’ in production mode

Create a helper file as,   app/helpers/bootstrap_flash_helper.rb Add these snippet into the file, ——————————————————————————– module BootstrapFlashHelper ALERT_TYPES = [:error, :info, :success, :warning] def bootstrap_flash flash_messages = [] flash.each do |type, message| # Skip empty messages, e.g. for devise messages set to nothing in a locale file. next if message.blank? type = :success if type == :notice […]