effective_bootstrap 0.0.25 → 0.0.26

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: b0034d69f81cdb19da4484ae2f177d94ea598b14
4
- data.tar.gz: c17d3ffb3930beb71d36119d3a55e8350dd39f51
3
+ metadata.gz: b736a331a5814c69fca221f9e5504e3cc53a203f
4
+ data.tar.gz: 089604a439cd7491e5d3892fcb1dfaa7d46a12e9
5
5
  SHA512:
6
- metadata.gz: bdb5114081df013c88f85b1842c84edece3be14a231d0290672d99aa8e95654ce43d65d65ac5dccea9eae634eb19ed81301fb4159667834e8b2330fca2cfd559
7
- data.tar.gz: 4649f5e1200d95c3dbff37c083d4ae7acd9329f47b5669444dba6149e7d571b3e901e7527e986154d543a588fcac67d77fa0264692d8bffb7e192543a91af278
6
+ metadata.gz: c9ee8121c6b9ee503fbe672b73dc8a647a742d02eb6c789c7f29cc0ddae9892611c33f3493e0e7697d600cd83505f62084d751dc27d90e4e9fd68a3ff508b7c3
7
+ data.tar.gz: b8ed30c89d8c3a889e6f142c009ca422c3ba492a23a39e7d2e48f5a7635ce87551b3cdf871302ff10dc277f4600acfbfc4edb72a61fff19c13d0da772ecff87a
@@ -5,15 +5,14 @@ module EffectiveFormBuilderHelper
5
5
 
6
6
  # Compute the default ID
7
7
  subject = Array(options[:scope] || options[:model]).last
8
+ class_name = subject.class.name.parameterize.underscore
8
9
 
9
10
  html_id = if subject.kind_of?(Symbol)
10
- subject
11
- elsif subject.respond_to?(:new_record?) && subject.new_record?
12
- "new_#{subject.class.name.underscore}"
11
+ subject.to_s
13
12
  elsif subject.respond_to?(:persisted?) && subject.persisted?
14
- "edit_#{subject.class.name.underscore}_#{subject.to_param}"
13
+ "edit_#{class_name}_#{subject.to_param}"
15
14
  else
16
- raise 'Unexpected subject. Expected :scope or :model to be a symbol or ActiveRecord object'
15
+ "new_#{class_name}"
17
16
  end
18
17
 
19
18
  remote_index = options.except(:model).hash.abs
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.0.25'.freeze
2
+ VERSION = '0.0.26'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect