Skip to content

iandb/merb_stateful_display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages