bowtie 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bowtie.gemspec +1 -1
- data/lib/bowtie/views/field.erb +4 -10
- data/lib/bowtie/views/form.erb +1 -1
- metadata +3 -3
data/bowtie.gemspec
CHANGED
data/lib/bowtie/views/field.erb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
<%=
|
2
2
|
|
3
|
-
html =''
|
4
3
|
name = @p
|
5
4
|
begin
|
6
5
|
value = @resource.send(@p)
|
@@ -8,17 +7,12 @@
|
|
8
7
|
value = ''
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@resource.model.options_for_subtype(name.to_sym).each do |option|
|
15
|
-
selected = value.to_s == option.to_s ? 'selected="selected"' : ''
|
16
|
-
html += '<option value="'+option.to_s+'" '+selected+'>'+option.to_s.titleize+'</option>'
|
17
|
-
end
|
18
|
-
html += '</select>'
|
10
|
+
html =''
|
11
|
+
|
12
|
+
case value.class.name
|
19
13
|
when "TrueClass", "FalseClass", /Boolean/
|
20
14
|
checked = value == true ? 'checked="checked"' : ''
|
21
|
-
html += '<input name="resource['+name+']" type="checkbox" '+checked+' />'
|
15
|
+
html += '<input name="resource['+name.to_s+']" type="checkbox" '+checked+' />'
|
22
16
|
else
|
23
17
|
html += '<input class="string" type="text" name="resource['+name.to_s+']" value="'+value.to_s+'" />'
|
24
18
|
end
|
data/lib/bowtie/views/form.erb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
<% @p = p %>
|
14
14
|
<% next if %w(id _id created_at _created_at _type).include?(@p.to_s) %>
|
15
15
|
<tr>
|
16
|
-
<td class="left-col"><%= @p.to_s
|
16
|
+
<td class="left-col"><%= @p.to_s %> <small>(<%= @resource.send(p).class.name %>)</small></td>
|
17
17
|
<td class="right-col"><%= partial(:field) %></td>
|
18
18
|
</tr>
|
19
19
|
<% end %>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowtie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 6
|
10
|
+
version: 0.4.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Tom\xC3\xA1s Pollak"
|