module FontAwesome::Rails::CDN::ActionViewExtensions
Constants
- DEFAULT_HOST
- FONTAWESOME_VERSIONS
- OFFLINE
Public Instance Methods
fontawesome_stylesheet_link_tag(host = DEFAULT_HOST, options = {}, html_options = {})
click to toggle source
# File lib/fontawesome-rails-cdn/action_view_helpers.rb, line 11 def fontawesome_stylesheet_link_tag(host = DEFAULT_HOST, options = {}, html_options = {}) local = fontawesome_stylesheet_url(:local, options) options[:version] = options[:version] || FONTAWESOME_VERSIONS.first if OFFLINE and !options[:force] and FONTAWESOME_VERSIONS.include?(options[:version]) stylesheet_link_tag(local, html_options) else stylesheet_link_tag(fontawesome_stylesheet_url(host, options), html_options) end end
fontawesome_stylesheet_url(host = DEFAULT_HOST, options = {})
click to toggle source
# File lib/fontawesome-rails-cdn/action_view_helpers.rb, line 7 def fontawesome_stylesheet_url(host = DEFAULT_HOST, options = {}) fontawesome_cdn_url(host, options) end
Private Instance Methods
fontawesome_cdn_url(host, options = {})
click to toggle source
# File lib/fontawesome-rails-cdn/action_view_helpers.rb, line 24 def fontawesome_cdn_url(host, options = {}) version = options[:version] || FONTAWESOME_VERSIONS.first { :netdna => "//netdna.bootstrapcdn.com/font-awesome/#{version}/css/font-awesome.min.css", :local => "font-awesome-#{version}.min.css" }[host] end