Sha256: f1d2c6153627df683f61622ccf4ab292ff15ad98a32b77cfb6b27bf04fe8bf27

Contents?: true

Size: 1.65 KB

Versions: 2

Compression:

Stored size: 1.65 KB

Contents

= Common View Helpers

A lightweight set of view helpers Gemini uses in all of our Rails applications.

== Installation

  gem install common_view_helpers

== Summary

  # Use words if within the last week, otherwise use date
  # Show year if not this year
  time_ago_in_words_or_date(date, options={})
  
  # Output an easily styleable key-value pair
  info_pair(label, value)  

  # Give this helper an array, and get back a string of <li> elements. 
  # The first item gets a class of first and the last, well.. last. 
  # This makes it easier to apply CSS styles to lists, be they ordered or unordered.
  # http://zeke.tumblr.com/post/98025647/a-nice-little-view-helper-for-generating-list-items
  convert_to_list_items(items)

  # This works just like link_to, but with one difference..
  # If the link is to the current page, a class of 'active' is added
  link(name, options={}, html_options={})

  # Absolute path to an image
  image_url(source)

  # e.g. http://localhost:3000, or https://productionserver.com
  base_url

  # Generate a list of column name-value pairs for an AR object
  list_model_columns(obj)
  
  # Javascript friendly (escaped) string
  js_string(string)
  
  # Generates a URL and automatically adds http:// if not already there
  # Useful alongside link() when linking to user submitted addresses
  urlify(address)
  
  # Breaks up a BigNum, FixNum or Float with commas
	# e.g., 532566 => 532,566 and 79593255.66 => 79,593,255.66 
	commify(num)

== Copyright & Licensing

Copyright (c) 2010 {Gemini SBS}[http://geminisbs.com], released under the MIT license

== Authors

* {Zeke Sikelianos}[http://github.com/zeke]
* {Mauricio Gomes}[http://github.com/mgomes]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
common_view_helpers-0.3.1 README.rdoc
common_view_helpers-0.3.0 README.rdoc