yui-on-rails 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/yui-on-rails/radio_buttons.rb +7 -6
- data/yui-on-rails.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.15
|
@@ -1,24 +1,25 @@
|
|
1
1
|
module YuiOnRails
|
2
2
|
module RadioButtons
|
3
|
-
def radio_buttons_for(
|
4
|
-
radio_buttons = YuiOnRails::RadioButtons::RadioButtonsRenderer.new(
|
3
|
+
def radio_buttons_for(name,*options, &block)
|
4
|
+
radio_buttons = YuiOnRails::RadioButtons::RadioButtonsRenderer.new(name,*options, &block)
|
5
5
|
radios_html = radio_buttons.render
|
6
6
|
return concat(radios_html)
|
7
7
|
end
|
8
8
|
|
9
9
|
class RadioButtonsRenderer
|
10
10
|
|
11
|
-
def initialize( options={}, &block )
|
11
|
+
def initialize(name, options={}, &block )
|
12
12
|
raise ArgumentError, "Missing block" unless block_given?
|
13
13
|
@template = eval( 'self', block.binding )
|
14
14
|
@options = options
|
15
|
+
@name = name
|
15
16
|
@radio_buttons = []
|
16
17
|
yield self
|
17
18
|
end
|
18
19
|
|
19
|
-
def create(
|
20
|
+
def create(button_text,options={})
|
20
21
|
raise "You must provide a button name dummy.#CREATE" if button_name.blank?
|
21
|
-
@radio_buttons << [
|
22
|
+
@radio_buttons << [button_text, options]
|
22
23
|
end
|
23
24
|
|
24
25
|
def render
|
@@ -29,7 +30,7 @@ module YuiOnRails
|
|
29
30
|
def render_bodies
|
30
31
|
#content_tag :div, :class=>"yui-content" do
|
31
32
|
@radio_buttons.collect do |radio_button|
|
32
|
-
radio_button_tag(
|
33
|
+
radio_button_tag(@name, radio_button[0], false, radio_button[1])
|
33
34
|
end.join.to_s
|
34
35
|
#end
|
35
36
|
end
|
data/yui-on-rails.gemspec
CHANGED