/merb_stateful_display

Simple extension of Merb's display() that chooses templates based on an object's state

Primary LanguageRubyMIT LicenseMIT

merb_stateful_display
=====================

stateful_display()
Works like display, but checks to see if the object has a 'state'
method.  Especially useful in show and edit, where it will check 
a given object and look for a template to match the current state
of the object.

EX:
def show
  ...
  @ord.state = 'in_cart'
  sdisplay(@ord)
end

Looks for a template named "show_in_cart.html.erb" else it falls
back to a standard behavior of "show.html.erb"