Module StaticMatic::Helpers
In: lib/staticmatic/helpers.rb

Methods

current_page   img   javascripts   link   link_to   partial   stylesheets   tag   text_area   text_field   urlify  

Public Instance methods

Generates an image tag always relative to the current page unless absolute path or http url specified.

img(‘test_image.gif’) -> <img src="/images/test_image.gif" alt="Test image"/> img(‘contact/test_image.gif’) -> <img src="/images/contact/test_image.gif" alt="Test image"/> img(‘’) -> <img src="" alt="Test image"/>

Generate javascript source tags for the specified files

javascripts(‘test’) -> <script language="javascript" src="javascripts/test.js"></script>

Generate an HTML link

If only the title is passed, it will automatically create a link from this value:

link(‘Test’) -> <a href="test.html">Test</a>

link_to(title, href = "", options = {})

Alias for link

Generates links to all stylesheets in the source directory

stylesheets

or specific stylesheets in a specific order

stylesheets :reset, :application

Can also pass options hash in at the end so you can specify :media => :print

Generates HTML tags:

tag(:br) -> <br/> tag(:a, :href => ‘test.html’) { "Test" } -> <a href="test.html">Test</a>

Generates a form text field

Generates a URL friendly string from the value passed:

"We love Haml" -> "we_love_haml" "Elf & Ham" -> "elf_and_ham" "Stephen‘s gem" -> "stephens_gem"

[Validate]