Padrino::Helpers::AssetTagHelpers
Module: Padrino::Helpers::AssetTagHelpers
Overview
Helpers related to producing assets (images, stylesheets, js, etc) within templates.
Constant Summary
- APPEND_ASSET_EXTENSIONS =
["js", "css"]
- ABSOLUTE_URL_PATTERN =
%r{^(https?://)}
- ASSET_FOLDERS =
{ :js => 'javascripts', :css => 'stylesheets', }
Instance Method Summary
-
#asset_path(kind, source = nil) ⇒ String
Returns the path to the specified asset (css or javascript). -
#favicon_tag(source, options = {}) ⇒ String
Generates a favicon link. -
#feed_tag(mime, url, options = {}) ⇒ String
Creates a link tag that browsers and news readers can use to auto-detect an RSS or ATOM feed. -
#flash_tag(*args) ⇒ String
Creates a div to display the flash of given type if it exists. -
#image_alt(src) ⇒ String
Returns a string suitable for an alt attribute of img element. -
#image_path(src) ⇒ String
Returns the path to the image, either relative or absolute. -
#image_tag(url, options = {}) ⇒ String
Creates an image element with given url and options. -
#javascript_include_tag(*sources, options = {}) ⇒ String
Returns a html script tag for each of the sources provided. -
#link_to(*args, &block) ⇒ String
Creates a link element with given name, url and options. -
#mail_to(email, caption = nil, mail_options = {}) ⇒ String
Creates a mail link element with given name and caption. -
#meta_tag(content, options = {}) ⇒ String
Creates a meta element with the content and given options. -
#stylesheet_link_tag(*sources, options = {}) ⇒ String
Returns a html link tag for each of the sources provided.
Instance Method Details
#asset_path(kind, source = nil) ⇒ String
Returns the path to the specified asset (css or javascript).
#favicon_tag(source, options = {}) ⇒ String
Generates a favicon link. Looks inside images folder
#feed_tag(mime, url, options = {}) ⇒ String
Creates a link tag that browsers and news readers can use to auto-detect an RSS or ATOM feed.
@param options
The options for the feed tag.
#flash_tag(*args) ⇒ String
Creates a div to display the flash of given type if it exists.
#image_alt(src) ⇒ String
Returns a string suitable for an alt attribute of img element.
#image_path(src) ⇒ String
Returns the path to the image, either relative or absolute. We search it in your appname.public_folder
like app/public/images for inclusion. You can provide also a full path.
#image_tag(url, options = {}) ⇒ String
Creates an image element with given url and options.
#javascript_include_tag(*sources, options = {}) ⇒ String
Returns a html script tag for each of the sources provided. You can pass in the filename without extension or a symbol and we search it in your appname.public_folder
like app/public/javascript for inclusion. You can provide also a full path.
#link_to(caption, url, options = {}) ⇒ String #link_to(url, options = {}, &block) ⇒ String
Creates a link element with given name, url and options.
Note that you can pass :if
or :unless
conditions, but if you provide :current as condition padrino return true/false if the request.path_info match the given url.
#mail_to(email, caption = nil, mail_options = {}) ⇒ String
Creates a mail link element with given name and caption.
#meta_tag(content, options = {}) ⇒ String
Creates a meta element with the content and given options.
#stylesheet_link_tag(*sources, options = {}) ⇒ String
Returns a html link tag for each of the sources provided. You can pass in the filename without extension or a symbol and we search it in your appname.public_folder
like app/public/stylesheets for inclusion. You can provide also a full path.
© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Helpers/AssetTagHelpers