asples_sinatra 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cf5b72922dd3702e331841f1d294397359de70e
4
- data.tar.gz: 1ef28e45b5f721e5fdec9146d1c9cdd6a44e3b83
3
+ metadata.gz: 9026efc1dcc1b09009accd4c341e1711c00ccfde
4
+ data.tar.gz: 4b699739d64312a57f664bd40c8a17e39d24d4bf
5
5
  SHA512:
6
- metadata.gz: 76e372879591c9a80e0b9212c1fc871531ac9b23785840ca22d46e6a07c957d2e697e92d622c34a45fdce2bcd904f7d40ba3ec6bb11252b906b3011b0b20a3e2
7
- data.tar.gz: 445a43caa6cd8d4466db80edcdc7cb3bb6143e1ae9de833a0fc9e6e64f156d39c8beca07706b78ee7e551961ae8f84379f9555a03c56d2a0f0350f33bb6bf3d1
6
+ metadata.gz: f32012a67a37414f1d095fa390450307441a2343f90988688808341ab196cca98f98a0bd880e062b157581781786812b0dfb008d0e7c41594a5589d22af9178b
7
+ data.tar.gz: e40ed2e41466855620b02b23c56c51e67ede32925afd219e6290a859aac42998c5b64bda621a34101315ca104e1713eaee91208447493406e6558b5b730eb451
@@ -1,3 +1,4 @@
1
+ enable :inline_templates
1
2
  module AsplesSinatra
2
3
  module Helpers
3
4
  def input(name, options={})
@@ -5,3 +6,16 @@ module AsplesSinatra
5
6
  end
6
7
  end
7
8
  end
9
+
10
+
11
+ __END__
12
+
13
+ @@ input
14
+ %div{class: "form-group #{object.errors[field_name].any? && "has-error"}"}
15
+ -field_type = defined?(as) && as.present? ? as : :text
16
+ -field_label = defined?(label) && label.present? ? label : field_name.to_s.humanize
17
+ -field_placeholder = defined?(placeholder) && placeholder.present? ? placeholder : "Enter #{field_name.to_s.humanize.downcase}"
18
+ %label.control-label{for: field_name}="#{field_label}:"
19
+ %input{type: field_type, name: field_name, class: "form-control", placeholder: field_placeholder, value: object.send(field_name)}
20
+ %span.help-block
21
+ = object.errors[field_name].join('. ') if object.errors.any?
@@ -1,3 +1,3 @@
1
1
  module AsplesSinatra
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asples_sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Evensen