bootstrap-ruby/rails-bootstrap-navbar

View on GitHub
lib/rails-bootstrap-navbar/railtie.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'bootstrap-navbar'

module BootstrapNavbar::Helpers
  def prepare_html(html)
    html.html_safe
  end
end

module RailsBootstrapNavbar
  class Railtie < Rails::Railtie
    config.after_initialize do
      BootstrapNavbar.configure do |config|
        config.current_url_method = if Rails.version >= '3.2'
          'request.original_url'
        else
          '[request.protocol, request.host_with_port, request.fullpath].join'
        end
      end

      ActionView::Base.send :include, BootstrapNavbar::Helpers
    end
  end
end