qm-acts-as-generic-controller 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  gemspec.email = "marcin@saepia.net"
10
10
  gemspec.homepage = "http://q.saepia.net"
11
11
  gemspec.authors = ["Marcin Lewandowski"]
12
- gemspec.version = "0.0.12"
12
+ gemspec.version = "0.0.13"
13
13
  gemspec.files = Rake::FileList.new [ "MIT-LICENSE", "Rakefile", "lib/*", "app/views/generic_controller/*" ]
14
14
  gemspec.add_dependency "qui-common-helpers", ">= 0.0.6"
15
15
  gemspec.add_dependency "qui-tabs", ">= 0.0.3"
@@ -55,12 +55,18 @@
55
55
  <%- end -%>
56
56
 
57
57
  <%- else -%>
58
- <%- if record.column_for_attribute(attribute_name).type == :text -%>
59
- <%= f.text_area attribute_name, :rows => 5, :cols => 60 %>
60
- <%- elsif record.column_for_attribute(attribute_name).type == :date -%>
61
- <%= f.calendar_date_select attribute_name %>
62
- <%- else -%>
63
- <%= f.text_field attribute_name %>
58
+ <%- case record.column_for_attribute(attribute_name).type -%>
59
+ <%- when :text -%>
60
+ <%= f.text_area attribute_name, :rows => 5, :cols => 60 %>
61
+ <%- when :date -%>
62
+ <%= f.calendar_date_select attribute_name %>
63
+ <%- when :boolean -%>
64
+ <span class="boolean">
65
+ <%= f.radio_button attribute_name, "1", { :checked => params[table_name] && params[table_name].has_key?(attribute_name) ? params[table_name][attribute_name] == "1" : f.object.send(attribute_name) == true } %><%= f.label attribute_name, t(:"genericController.yesAsBooleanOption"), { :for => "#{f.object.class.to_s.tableize.singularize}_#{attribute_name}_1" } %>
66
+ <%= f.radio_button attribute_name, "0", { :checked => params[table_name] && params[table_name].has_key?(attribute_name) ? params[table_name][attribute_name] == "0" : f.object.send(attribute_name) == false } %><%= f.label attribute_name, t(:"genericController.noAsBooleanOption"), { :for => "#{f.object.class.to_s.tableize.singularize}_#{attribute_name}_0" } %>
67
+ </span>
68
+ <%- else -%>
69
+ <%= f.text_field attribute_name %>
64
70
  <%- end -%>
65
71
  <%- end -%>
66
72
  </li>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qm-acts-as-generic-controller
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 12
10
- version: 0.0.12
9
+ - 13
10
+ version: 0.0.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcin Lewandowski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-13 00:00:00 +02:00
18
+ date: 2010-10-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency