andy_admin 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,13 +8,14 @@ class AndyAdmin::FormBuilder < ActionView::Helpers::FormBuilder
|
|
8
8
|
define_method(name) do |field_name, *args|
|
9
9
|
options = args.extract_options!
|
10
10
|
options[:title] ||= field_name.to_s.humanize
|
11
|
-
heading = "<h2>" + options[:title] + "</h2>"
|
11
|
+
heading = ("<h2>" + options[:title] + "</h2>").html_safe
|
12
12
|
heading += error_message_on(field_name, args)
|
13
13
|
description = if options[:description]
|
14
|
-
@template.content_tag(:div, options[:description], :class => "description")
|
14
|
+
@template.content_tag(:div, options[:description].html_safe, :class => "description")
|
15
15
|
else
|
16
|
-
""
|
16
|
+
"".html_safe
|
17
17
|
end
|
18
|
+
input = "".html_safe
|
18
19
|
options.merge!({:class => name})
|
19
20
|
if name == "check_box"
|
20
21
|
label = label(field_name, options[:label])
|
@@ -29,16 +30,16 @@ class AndyAdmin::FormBuilder < ActionView::Helpers::FormBuilder
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def actions
|
32
|
-
@template.concat @template.content_tag(:div, yield, :class => "actions")
|
33
|
+
@template.concat @template.content_tag(:div, yield.html_safe, :class => "actions")
|
33
34
|
end
|
34
35
|
|
35
36
|
def submit(label, *args)
|
36
37
|
options = args.extract_options!
|
37
38
|
options[:colour] ||= "green"
|
38
|
-
@template.content_tag(:button, label, :class => "awesome #{options[:colour]}", :type => "submit")
|
39
|
+
@template.content_tag(:button, label.html_safe, :class => "awesome #{options[:colour]}", :type => "submit")
|
39
40
|
end
|
40
41
|
|
41
42
|
def cancel(label, link)
|
42
|
-
@template.content_tag(:a, label, :href => link)
|
43
|
+
@template.content_tag(:a, label.html_safe, :href => link)
|
43
44
|
end
|
44
45
|
end
|