lib/layouts.rb
# check if a the given view exists within the app/views folder
# make sure only allowed extensions are found
check if a the given view exists within the app/views folder
make sure only allowed extensions are found
check if a the given view exists within the app / views folder make sure only allowed extensions are found
def template_exists?(file_name)
        return true if file_exists?(file_name)
        extensions = ActionMailer::Base.template_extensions
        extensions.each do |extension|
          [content_type.gsub('/', '.'), nil].each do |middle|
            full_name = [filename, middle, extension].compact.join('.')
            return true if file_exists?(full_name)
          end
        end
        false
      end
def template_exists? ( file_name ) return true if file_exists? ( file_name ) extensions = ActionMailer :: Base . template_extensions extensions . each do | extension | [ content_type . gsub ( '/' , '.' ) , nil ] . each do | middle | full_name = [ filename , middle , extension ] . compact . join ( '.' ) return true if file_exists? ( full_name ) end end false end
check if a the given view exists within the app/views folder
make sure only allowed extensions are found
check if a the given view exists within the app / views folder make sure only allowed extensions are found
file_name