first pass to distribute settings over tabs

This commit is contained in:
Reinier Balt 2011-07-27 17:19:05 +02:00
parent 3bf8c461f1
commit 977b57dbb2
5 changed files with 167 additions and 66 deletions

View file

@ -1,2 +1,18 @@
module PreferencesHelper
def pref(model, pref_name, &block)
s = "<label for #{model+pref_name}>#{Preference.human_attribute_name(pref_name)}:</label><br/>"
s << yield
s << "<br/><br/>"
s
end
def pref_with_select_field(model, pref_name, collection = [ [t('preferences.is_true'),true], [t('preferences.is_false'), false] ])
pref(model, pref_name) { select(model, pref_name, collection) }
end
def pref_with_text_field(model, pref_name, nowrap_label = false)
pref(model, pref_name) { text_field(model, pref_name) }
end
end