open_body_tag
#creates a body tag uniquely indentifying this page #takes an options Hash with two keys: # #<tt>id</tt>:: string that will be used as the body's ID. defaults to <tt>controller.controller_name.singularize</tt> #<tt>classes</tt>:: an Array of class names. defaults to <tt>[params[:action]]</tt> # #Examples: # # in HomeController#index: # # <%= open_body_tag %> # => <body id='home' class='index'> # # <%= open_body_tag(:id => 'foo') %> # => <body id='foo' class='index'> # # <%= open_body_tag(:id => 'foo', :classes => %w(one two)) %> # => <body id='foo' class='one two'> def open_body_tag(options = { :id => controller.controller_name.singularize, :classes => [params[:action]] }) "<body id='#{options[:id]}' class='#{options[:classes].join(' ')}'>" end