public
Description: Rails plugin to add extra searching functionality to models.
Clone URL: git://github.com/ryanb/searchify.git
customizing the text field size depending on the type (forgot to include 
file last commit)
Ryan Bates (author)
Wed Mar 19 10:45:17 -0700 2008
commit  90dfb66a77a8123172ab75fba3e1a39c410bc402
tree    2f1727d356a441d3f8a258e28d2dff4bb5af10cc
parent  a2fd1e4307c0a9480ec71eed079f78eaaeb3ae09
...
162
163
164
165
 
166
167
 
168
169
 
170
171
172
173
174
175
176
 
 
177
178
179
...
162
163
164
 
165
166
 
167
168
 
169
170
171
172
173
174
 
 
175
176
177
178
179
0
@@ -162,18 +162,18 @@ var SearchifyRow = Class.create({
0
   
0
   value_field_for_type: function(type) {
0
     if (type == "text" || type == "string") {
0
- return this.text_field('');
0
+ return this.text_field('', 24);
0
     } else if (type == "date" || type == "datetime") {
0
- return this.text_field('from') + " - " + this.text_field('to');
0
+ return this.text_field('from', 10) + " - " + this.text_field('to', 10);
0
     } else if (type == "integer" || type == "float" || type == "decimal") {
0
- return this.operator_menu() + " " + this.text_field('');
0
+ return this.operator_menu() + " " + this.text_field('', 8);
0
     } else if (type == "boolean") {
0
       return this.boolean_menu();
0
     }
0
   },
0
   
0
- text_field: function(name) {
0
- return "<input type='text' name='" + this.make_name(name) + "' value='" + this.escaped_value(name) + "' />";
0
+ text_field: function(name, size) {
0
+ return "<input type='text' name='" + this.make_name(name) + "' value='" + this.escaped_value(name) + "' size='" + size + "' />";
0
   },
0
   
0
   boolean_menu: function() {

Comments

    No one has commented yet.