tag with class 'formfield'
def display_form_field(label, html_for_field)
content_tag('div', content_tag('div', content_tag('label', label)) + html_for_field, :class => 'formfield')
end
alias_method :labelled_form_field, :display_form_field
def labelled_form_for(name, object = nil, options = {}, &proc)
object ||= instance_variable_get("@#{name}")
form_for(name, object, { :builder => NoosferoFormBuilder }.merge(options), &proc)
end
class NoosferoFormBuilder < ActionView::Helpers::FormBuilder
include GetText
(field_helpers - %w(hidden_field)).each do |selector|
src = <<-END_SRC
def #{selector}(field, *args, &proc)
column = object.class.columns_hash[field.to_s]
"
"
end
END_SRC
class_eval src, __FILE__, __LINE__
end
end
def category_color
if @category.nil?
""
else
@category.top_ancestor.display_color
end
end
def rich_text_editor(object, method, options = {})
fckeditor_textarea(object, method, options.merge({:toolbarSet => 'Simple', :height => '300px'}))
end
end