summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/settings_controller.rb1
-rw-r--r--app/views/settings/edit.rhtml2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index 229a4ab3c..fd094adb3 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -29,5 +29,6 @@ class SettingsController < ApplicationController
params[:settings].each { |name, value| Setting[name] = value }
redirect_to :action => 'edit' and return
end
+ @textile_available = ActionView::Helpers::TextHelper.method_defined?("textilize")
end
end
diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml
index 4c9b55029..057a988de 100644
--- a/app/views/settings/edit.rhtml
+++ b/app/views/settings/edit.rhtml
@@ -37,7 +37,7 @@
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
<p><label><%= l(:setting_text_formatting) %></label>
-<%= select_tag 'settings[text_formatting]', options_for_select( [[l(:label_none), 0], ["textile", "textile"]], Setting.text_formatting) %></p>
+<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), 0], ["textile", "textile"]], (@textile_available ? Setting.text_formatting : 0)), :disabled => !@textile_available %></p>
<p><label><%= l(:setting_wiki_compression) %></label>
<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>