summaryrefslogtreecommitdiffstats
path: root/app/helpers/settings_helper.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-29 10:53:26 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-29 10:53:26 +0000
commit45d05bd2d9afc47c2a0c31bfc2f4c902d4d0f919 (patch)
treeebffec8d132863576336a0a9bd777bc31e4a3ab1 /app/helpers/settings_helper.rb
parentc9abe704671707821c62e27c2e26bd425f10d74e (diff)
downloadredmine-45d05bd2d9afc47c2a0c31bfc2f4c902d4d0f919.tar.gz
redmine-45d05bd2d9afc47c2a0c31bfc2f4c902d4d0f919.zip
code clean up settings helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5950 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/settings_helper.rb')
-rw-r--r--app/helpers/settings_helper.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index a5f10586c..4c7a7c44e 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -33,7 +33,9 @@ module SettingsHelper
choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
end
setting_label(setting, options) +
- select_tag("settings[#{setting}]", options_for_select(choices, Setting.send(setting).to_s), options)
+ select_tag("settings[#{setting}]",
+ options_for_select(choices, Setting.send(setting).to_s),
+ options)
end
def setting_multiselect(setting, choices, options={})
@@ -44,10 +46,15 @@ module SettingsHelper
hidden_field_tag("settings[#{setting}][]", '') +
choices.collect do |choice|
text, value = (choice.is_a?(Array) ? choice : [choice, choice])
- content_tag('label',
- check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
+ content_tag(
+ 'label',
+ check_box_tag(
+ "settings[#{setting}][]",
+ value,
+ Setting.send(setting).include?(value)
+ ) + text.to_s,
:class => 'block'
- )
+ )
end.join
end
@@ -64,7 +71,7 @@ module SettingsHelper
def setting_check_box(setting, options={})
setting_label(setting, options) +
hidden_field_tag("settings[#{setting}]", 0) +
- check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
+ check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
end
def setting_label(setting, options={})