desktop-finder 0.0.1.7 → 0.0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/desktop/finder/version.rb +1 -1
- data/lib/desktop/finder.rb +22 -2
- metadata +1 -1
data/lib/desktop/finder.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
require "desktop/finder/version"
|
2
|
-
require "action_view/helpers/tag_helper"
|
3
|
-
require "action_support/core_ext"
|
4
2
|
|
5
3
|
module Desktop
|
6
4
|
class Finder
|
@@ -69,6 +67,28 @@ module Desktop
|
|
69
67
|
where = params.reject{|p,v| p=='controller' or p=='action' or p=='search' or p=='commit' or v.empty?}
|
70
68
|
where
|
71
69
|
end
|
70
|
+
|
71
|
+
def submit_tag(label, options)
|
72
|
+
"<input type=\"button\" value='#{label}' class='#{options[:class]}' onclick='this.parent(\"form\").submit();' />"
|
73
|
+
end
|
74
|
+
|
75
|
+
def text_field_tag(name, value, options)
|
76
|
+
"<input type='text' name='#{name}' value='#{value}' class='#{options[:class]}' />"
|
77
|
+
end
|
78
|
+
|
79
|
+
def select_tag(name, options, value)
|
80
|
+
s = "<select name=\"#{name}\">"
|
81
|
+
options.each do|p|
|
82
|
+
s << '<option value='+ p.fetch(0) +'>' + p.many? ? p.fetch(1) : p.fetch(0) + '</option>'
|
83
|
+
end
|
84
|
+
s << '</select>'
|
85
|
+
s
|
86
|
+
end
|
87
|
+
|
88
|
+
def label_tag(id, label, options)
|
89
|
+
"<label class='#{options[:class]}'>#{label}</label>"
|
90
|
+
end
|
91
|
+
|
72
92
|
end
|
73
93
|
end
|
74
94
|
end
|