- def note_author(object, link_options = {})
- if object.author.nil?
- h(object.author_name)
- else
- link_to h(object.author_name), link_options.merge({:controller => "user", :action => "view", :display_name => object.author_name})
- end
- end
-
- def with_format(format, &block)
- old_format = @template_format
- @template_format = format
- result = block.call
- @template_format = old_format
- return result
- end
-
-private
-
- def javascript_strings_for_key(key)
- js = ""
- value = I18n.t(key, :locale => "en")
-
- if value.is_a?(String)
- js << "i18n_strings['#{key}'] = '" << escape_javascript(t(key)) << "';\n"
- else
- value.each_key do |k|
- js << javascript_strings_for_key("#{key}.#{k}")
- end
- end
-
- return js
+ def body_class
+ [params[:controller], "#{params[:controller]}-#{params[:action]}", @extra_body_class].compact.join(" ")