From 0f3f61b45605b14d7b586999e821a7e66c7f892b Mon Sep 17 00:00:00 2001
From: AntonioTerceiro
Date: Wed, 10 Oct 2007 20:01:30 +0000
Subject: [PATCH] ActionItem85: using text_editor instead of text_area and generating a textarea with a better size
---
app/helpers/application_helper.rb | 13 +++++++++----
app/views/membership_editor/_form.rhtml | 2 +-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f86704b..36b17a5 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -199,16 +199,21 @@ module ApplicationHelper
end
end
- def text_editor(object, method, filter_type_method, options = {})
- filter_type = instance_variable_get("@#{object}").send(filter_type_method)
+ def text_editor(object, method, filter_type_method = nil, options = {})
+ filter_type =
+ if filter_type_method.blank?
+ ''
+ else
+ instance_variable_get("@#{object}").send(filter_type_method)
+ end
if filter_type == '[No Filter]' || filter_type.blank?
html_class = "tiny_mce_editor"
if options[:class]
html_class << " #{options[:class]}"
end
- text_area(object, method, { :rows => 12, :columns => 72 }.merge(options).merge({:class => html_class}))
+ text_area(object, method, { :size => '72x12' }.merge(options).merge({:class => html_class}))
else
- text_area(object, method, { :rows => 12, :columns => 72 }.merge(options))
+ text_area(object, method, { :size => '72x12' }.merge(options))
end
end
diff --git a/app/views/membership_editor/_form.rhtml b/app/views/membership_editor/_form.rhtml
index c435e07..cb9a43a 100644
--- a/app/views/membership_editor/_form.rhtml
+++ b/app/views/membership_editor/_form.rhtml
@@ -23,7 +23,7 @@
<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %>
-<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %>
+<%= text_editor 'organization_info', 'management_information' %>
<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %>
--
libgit2 0.21.2