Sha256: d099823b885027a6e4704ad6dd44790dcae998b29eef346c1c0ec11304c9f81a

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

= Common View Helpers

A 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)

== 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

1 entries across 1 versions & 1 rubygems

Version Path
common_view_helpers-0.1.0 README.rdoc