scaffold_plus 1.4.0 → 1.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4aab6e083182126fb602ed441d287d0c41acedb
|
4
|
+
data.tar.gz: 839075341d53fcd54653600148f5b3a30c4de7eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f26d80e516a8d9299e94dabd2802c8c8891176fb02295e73af0445ea7eb393c01997108f46f53e7dfc2a2eb78e5d4d2eb53bf61d7bee0eaf294c22b123c97b45
|
7
|
+
data.tar.gz: b30579ce6a93d3631892273291af6e6f6a6c36d724255e4ecd6970c682caf8c33d8db2f13dfe49198943634beb790063b2269841ca6e212e6a1668d3bc567636
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rails/generators/active_record'
|
2
|
+
|
3
|
+
module ScaffoldPlus
|
4
|
+
module Generators
|
5
|
+
class AutofocusGenerator < ActiveRecord::Generators::Base
|
6
|
+
desc "Add autofocus to view"
|
7
|
+
argument :name, type: :string,
|
8
|
+
desc: "The object to be updated"
|
9
|
+
argument :column, type: :string,
|
10
|
+
desc: 'The column name to be focused'
|
11
|
+
|
12
|
+
def add_to_view
|
13
|
+
file = "app/views/#{table_name}/_form.html.erb"
|
14
|
+
gsub_file file, /(:#{column}) %>/, "\\1, autofocus: true %>"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaffold_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volker Wiegand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- Rakefile
|
82
82
|
- lib/generators/scaffold_plus/ancestry/ancestry_generator.rb
|
83
83
|
- lib/generators/scaffold_plus/ancestry/templates/ancestry_migration.rb
|
84
|
+
- lib/generators/scaffold_plus/autofocus/autofocus_generator.rb
|
84
85
|
- lib/generators/scaffold_plus/collection/collection_generator.rb
|
85
86
|
- lib/generators/scaffold_plus/collection/templates/view.html.erb
|
86
87
|
- lib/generators/scaffold_plus/habtm/habtm_generator.rb
|
@@ -115,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
116
|
version: '0'
|
116
117
|
requirements: []
|
117
118
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.4.1
|
119
120
|
signing_key:
|
120
121
|
specification_version: 4
|
121
122
|
summary: A collection of little helpers for Rails scaffolding
|