homeschool 0.0.1.16 → 0.0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/form_buildr.rb +8 -3
- metadata +1 -1
data/Rakefile
CHANGED
@@ -85,7 +85,7 @@ desc "Publish the release files to RubyForge."
|
|
85
85
|
task :release => :package do
|
86
86
|
rubyforge do
|
87
87
|
login
|
88
|
-
|
88
|
+
raise "rubyforge not configured" if userconfig[:username] == 'username'
|
89
89
|
puts %{Preparing to release #{PKG_NAME}-#{PKG_VERSION}}
|
90
90
|
[:gem, :tgz, :zip].each_with_index do |ext, index|
|
91
91
|
send(index<1? :add_release : :add_file, PKG_RUBYFORGE_PROJECT, PKG_NAME, [PKG_NAME, PKG_VERSION]*'-', "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}")
|
data/lib/form_buildr.rb
CHANGED
@@ -38,8 +38,13 @@
|
|
38
38
|
#
|
39
39
|
class ActionView::Helpers::FormBuilder
|
40
40
|
|
41
|
-
def
|
42
|
-
|
41
|
+
def labeled_radio_button(method, tag_value, options={})
|
42
|
+
id = %{#{@object_name}_#{method}_#{tag_value}}
|
43
|
+
return send(:radio_button, method, tag_value, {:id => id}.update(options.without(:label, :no_colon))) + send(:label_for, method, {:no_colon => true, :label => tag_value.humanize, :id => id}.update(options))
|
44
|
+
end
|
45
|
+
|
46
|
+
def labeled_check_box(method, options={}, checked_value="1", unchecked_value="0")
|
47
|
+
return send(:check_box, method, options.without(:label, :no_colon), checked_value, unchecked_value) + send(:label_for, method, options.update(:no_colon => true))
|
43
48
|
end
|
44
49
|
|
45
50
|
rdef(/labeled_(.*)/) do |match, *args|
|
@@ -48,6 +53,6 @@ class ActionView::Helpers::FormBuilder
|
|
48
53
|
|
49
54
|
def label_for(method, options={})
|
50
55
|
options = {:label => options} if options.is_a? String
|
51
|
-
%{<label class="fieldLabel" for="#{@object_name}_#{method}">#{options[:label] || method.to_s.humanize}#{":" if !options[:no_colon]}</label>}
|
56
|
+
%{<label class="fieldLabel" for="#{options[:id] || "#{@object_name}_#{method}"}">#{options[:label] || method.to_s.humanize}#{":" if !options[:no_colon]}</label>}
|
52
57
|
end
|
53
58
|
end
|