form_sample 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +28 -0
- data/Rakefile +5 -7
- data/app/assets/config/example_manifest.js +2 -0
- data/{test/dummy/app/assets/javascripts → app/assets/javascripts/example}/application.js +5 -3
- data/app/assets/javascripts/{posts.js → example/posts.js} +0 -0
- data/{test/dummy/app/assets/stylesheets → app/assets/stylesheets/example}/application.css +4 -4
- data/app/assets/stylesheets/{posts.css → example/posts.css} +0 -0
- data/app/controllers/example/application_controller.rb +5 -0
- data/app/controllers/{posts_controller.rb → example/posts_controller.rb} +9 -5
- data/app/helpers/example/application_helper.rb +4 -0
- data/app/helpers/example/posts_helper.rb +4 -0
- data/app/jobs/example/application_job.rb +4 -0
- data/app/mailers/example/application_mailer.rb +6 -0
- data/app/models/example/application_record.rb +5 -0
- data/app/models/example/post.rb +4 -0
- data/app/views/example/posts/create.html.erb +2 -0
- data/app/views/example/posts/destroy.html.erb +2 -0
- data/app/views/{posts → example/posts}/edit.html.erb +1 -1
- data/app/views/{posts → example/posts}/index.html.erb +0 -0
- data/app/views/{posts → example/posts}/new.html.erb +1 -1
- data/app/views/example/posts/show.html.erb +2 -0
- data/app/views/example/posts/update.html.erb +2 -0
- data/app/views/layouts/example/application.html.erb +16 -0
- data/config/routes.rb +2 -2
- data/db/migrate/{20191012032749_create_posts.rb → 20191012052014_create_example_posts.rb} +1 -1
- data/lib/example.rb +5 -0
- data/lib/example/engine.rb +5 -0
- data/lib/example/version.rb +3 -0
- data/lib/tasks/{sample_tasks.rake → example_tasks.rake} +1 -1
- metadata +35 -106
- data/README.rdoc +0 -3
- data/app/helpers/posts_helper.rb +0 -2
- data/app/models/post.rb +0 -2
- data/app/views/posts/create.html.erb +0 -2
- data/app/views/posts/destroy.html.erb +0 -2
- data/app/views/posts/show.html.erb +0 -2
- data/app/views/posts/update.html.erb +0 -2
- data/lib/sample.rb +0 -4
- data/lib/sample/engine.rb +0 -4
- data/lib/sample/version.rb +0 -3
- data/test/controllers/posts_controller_test.rb +0 -39
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -37
- data/test/dummy/config/environments/production.rb +0 -78
- data/test/dummy/config/environments/test.rb +0 -39
- data/test/dummy/config/initializers/assets.rb +0 -8
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -56
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fixtures/posts.yml +0 -11
- data/test/helpers/posts_helper_test.rb +0 -4
- data/test/integration/navigation_test.rb +0 -10
- data/test/models/post_test.rb +0 -7
- data/test/sample_test.rb +0 -7
- data/test/test_helper.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae02f76f3eadb1c6bd8f8d1135da24e43f961061ed1fcb8f1692d2d9c9b3af69
|
4
|
+
data.tar.gz: dab069d34c1ab4a3b8c2c747688ca178180b4cc1d96996e1f45e5743bbdcef9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93bd4b1b1739c8c5a2006d8ef5fd40980ca01df07a1b4a29f997076c17df4cf313a18c84b6464ae207247ce815b87fcaa7ffcf2c16d23c1cfa97784ea55aa434
|
7
|
+
data.tar.gz: 2074e9f9800f77ca94db796f4d1bbbe25ac762c643d5d518a020d2e795de30a35175a33e120bda80a6e1cfb1e0b7651313b3b2047a2cd3e6e31ce32184d0ef27
|
data/MIT-LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Example
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'example'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install example
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
@@ -8,27 +8,25 @@ require 'rdoc/task'
|
|
8
8
|
|
9
9
|
RDoc::Task.new(:rdoc) do |rdoc|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = '
|
11
|
+
rdoc.title = 'Example'
|
12
12
|
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
-
APP_RAKEFILE = File.expand_path("
|
17
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
18
|
load 'rails/tasks/engine.rake'
|
19
19
|
|
20
|
+
load 'rails/tasks/statistics.rake'
|
20
21
|
|
21
|
-
|
22
|
-
Bundler::GemHelper.install_tasks
|
22
|
+
require 'bundler/gem_tasks'
|
23
23
|
|
24
24
|
require 'rake/testtask'
|
25
25
|
|
26
26
|
Rake::TestTask.new(:test) do |t|
|
27
|
-
t.libs << 'lib'
|
28
27
|
t.libs << 'test'
|
29
28
|
t.pattern = 'test/**/*_test.rb'
|
30
29
|
t.verbose = false
|
31
30
|
end
|
32
31
|
|
33
|
-
|
34
32
|
task default: :test
|
@@ -2,12 +2,14 @@
|
|
2
2
|
// listed below.
|
3
3
|
//
|
4
4
|
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
9
|
//
|
10
|
-
// Read Sprockets README (https://github.com/
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
12
12
|
//
|
13
|
+
//= require rails-ujs
|
14
|
+
//= require activestorage
|
13
15
|
//= require_tree .
|
File without changes
|
@@ -3,12 +3,12 @@
|
|
3
3
|
* listed below.
|
4
4
|
*
|
5
5
|
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any
|
10
|
-
*
|
11
|
-
* file per style scope.
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
12
|
*
|
13
13
|
*= require_tree .
|
14
14
|
*= require_self
|
File without changes
|
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require_dependency "example/application_controller"
|
2
|
+
|
3
|
+
module Example
|
4
|
+
class PostsController < ApplicationController
|
5
|
+
def index
|
3
6
|
@posts = Post.all
|
4
7
|
end
|
5
8
|
|
@@ -18,7 +21,7 @@ class PostsController < ApplicationController
|
|
18
21
|
@post = Post.new(post_params)
|
19
22
|
if @post.save
|
20
23
|
flash[:notice] = 'Post added!'
|
21
|
-
redirect_to
|
24
|
+
redirect_to posts_path
|
22
25
|
else
|
23
26
|
flash[:error] = 'Failed to edit Post!'
|
24
27
|
render :new
|
@@ -35,7 +38,7 @@ class PostsController < ApplicationController
|
|
35
38
|
@post = Post.find(params[:id])
|
36
39
|
if @post.update_attributes(post_params)
|
37
40
|
flash[:notice] = 'Post updated!'
|
38
|
-
redirect_to
|
41
|
+
redirect_to posts_path
|
39
42
|
else
|
40
43
|
flash[:error] = 'Failed to edit Post!'
|
41
44
|
render :edit
|
@@ -47,7 +50,7 @@ class PostsController < ApplicationController
|
|
47
50
|
@post = Post.find(params[:id])
|
48
51
|
if @post.delete
|
49
52
|
flash[:notice] = 'Post deleted!'
|
50
|
-
redirect_to
|
53
|
+
redirect_to posts_path
|
51
54
|
else
|
52
55
|
flash[:error] = 'Failed to delete this Post!'
|
53
56
|
render :destroy
|
@@ -58,4 +61,5 @@ class PostsController < ApplicationController
|
|
58
61
|
def post_params
|
59
62
|
params.require(:post).permit(:title, :description, :created_by)
|
60
63
|
end
|
64
|
+
end
|
61
65
|
end
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Example</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag "example/application", media: "all" %>
|
9
|
+
<%= javascript_include_tag "example/application" %>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
|
13
|
+
<%= yield %>
|
14
|
+
<h4>Hello</h4>
|
15
|
+
</body>
|
16
|
+
</html>
|
data/config/routes.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
resources :posts
|
1
|
+
Example::Engine.routes.draw do
|
2
|
+
resources :posts
|
3
3
|
end
|
data/lib/example.rb
ADDED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: form_sample
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- madhubabu-nyros
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -14,16 +14,16 @@ dependencies:
|
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.2.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.2.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mysql2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,66 +46,35 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- MIT-LICENSE
|
49
|
-
- README.
|
49
|
+
- README.md
|
50
50
|
- Rakefile
|
51
|
-
- app/assets/
|
52
|
-
- app/assets/
|
53
|
-
- app/
|
54
|
-
- app/
|
55
|
-
- app/
|
56
|
-
- app/
|
57
|
-
- app/
|
58
|
-
- app/
|
59
|
-
- app/
|
60
|
-
- app/
|
61
|
-
- app/
|
62
|
-
- app/
|
51
|
+
- app/assets/config/example_manifest.js
|
52
|
+
- app/assets/javascripts/example/application.js
|
53
|
+
- app/assets/javascripts/example/posts.js
|
54
|
+
- app/assets/stylesheets/example/application.css
|
55
|
+
- app/assets/stylesheets/example/posts.css
|
56
|
+
- app/controllers/example/application_controller.rb
|
57
|
+
- app/controllers/example/posts_controller.rb
|
58
|
+
- app/helpers/example/application_helper.rb
|
59
|
+
- app/helpers/example/posts_helper.rb
|
60
|
+
- app/jobs/example/application_job.rb
|
61
|
+
- app/mailers/example/application_mailer.rb
|
62
|
+
- app/models/example/application_record.rb
|
63
|
+
- app/models/example/post.rb
|
64
|
+
- app/views/example/posts/create.html.erb
|
65
|
+
- app/views/example/posts/destroy.html.erb
|
66
|
+
- app/views/example/posts/edit.html.erb
|
67
|
+
- app/views/example/posts/index.html.erb
|
68
|
+
- app/views/example/posts/new.html.erb
|
69
|
+
- app/views/example/posts/show.html.erb
|
70
|
+
- app/views/example/posts/update.html.erb
|
71
|
+
- app/views/layouts/example/application.html.erb
|
63
72
|
- config/routes.rb
|
64
|
-
- db/migrate/
|
65
|
-
- lib/
|
66
|
-
- lib/
|
67
|
-
- lib/
|
68
|
-
- lib/tasks/
|
69
|
-
- test/controllers/posts_controller_test.rb
|
70
|
-
- test/dummy/README.rdoc
|
71
|
-
- test/dummy/Rakefile
|
72
|
-
- test/dummy/app/assets/javascripts/application.js
|
73
|
-
- test/dummy/app/assets/stylesheets/application.css
|
74
|
-
- test/dummy/app/controllers/application_controller.rb
|
75
|
-
- test/dummy/app/helpers/application_helper.rb
|
76
|
-
- test/dummy/app/views/layouts/application.html.erb
|
77
|
-
- test/dummy/bin/bundle
|
78
|
-
- test/dummy/bin/rails
|
79
|
-
- test/dummy/bin/rake
|
80
|
-
- test/dummy/config.ru
|
81
|
-
- test/dummy/config/application.rb
|
82
|
-
- test/dummy/config/boot.rb
|
83
|
-
- test/dummy/config/database.yml
|
84
|
-
- test/dummy/config/environment.rb
|
85
|
-
- test/dummy/config/environments/development.rb
|
86
|
-
- test/dummy/config/environments/production.rb
|
87
|
-
- test/dummy/config/environments/test.rb
|
88
|
-
- test/dummy/config/initializers/assets.rb
|
89
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
90
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
91
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
92
|
-
- test/dummy/config/initializers/inflections.rb
|
93
|
-
- test/dummy/config/initializers/mime_types.rb
|
94
|
-
- test/dummy/config/initializers/session_store.rb
|
95
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
96
|
-
- test/dummy/config/locales/en.yml
|
97
|
-
- test/dummy/config/routes.rb
|
98
|
-
- test/dummy/config/secrets.yml
|
99
|
-
- test/dummy/public/404.html
|
100
|
-
- test/dummy/public/422.html
|
101
|
-
- test/dummy/public/500.html
|
102
|
-
- test/dummy/public/favicon.ico
|
103
|
-
- test/fixtures/posts.yml
|
104
|
-
- test/helpers/posts_helper_test.rb
|
105
|
-
- test/integration/navigation_test.rb
|
106
|
-
- test/models/post_test.rb
|
107
|
-
- test/sample_test.rb
|
108
|
-
- test/test_helper.rb
|
73
|
+
- db/migrate/20191012052014_create_example_posts.rb
|
74
|
+
- lib/example.rb
|
75
|
+
- lib/example/engine.rb
|
76
|
+
- lib/example/version.rb
|
77
|
+
- lib/tasks/example_tasks.rake
|
109
78
|
homepage: https://rubygems.org
|
110
79
|
licenses:
|
111
80
|
- MIT
|
@@ -125,48 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
94
|
- !ruby/object:Gem::Version
|
126
95
|
version: '0'
|
127
96
|
requirements: []
|
128
|
-
rubygems_version: 3.0.
|
97
|
+
rubygems_version: 3.0.3
|
129
98
|
signing_key:
|
130
99
|
specification_version: 4
|
131
100
|
summary: simple form
|
132
|
-
test_files:
|
133
|
-
- test/models/post_test.rb
|
134
|
-
- test/dummy/Rakefile
|
135
|
-
- test/dummy/bin/rake
|
136
|
-
- test/dummy/bin/bundle
|
137
|
-
- test/dummy/bin/rails
|
138
|
-
- test/dummy/config.ru
|
139
|
-
- test/dummy/app/helpers/application_helper.rb
|
140
|
-
- test/dummy/app/views/layouts/application.html.erb
|
141
|
-
- test/dummy/app/assets/javascripts/application.js
|
142
|
-
- test/dummy/app/assets/stylesheets/application.css
|
143
|
-
- test/dummy/app/controllers/application_controller.rb
|
144
|
-
- test/dummy/config/locales/en.yml
|
145
|
-
- test/dummy/config/initializers/assets.rb
|
146
|
-
- test/dummy/config/initializers/session_store.rb
|
147
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
148
|
-
- test/dummy/config/initializers/inflections.rb
|
149
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
150
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
151
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
152
|
-
- test/dummy/config/initializers/mime_types.rb
|
153
|
-
- test/dummy/config/environment.rb
|
154
|
-
- test/dummy/config/application.rb
|
155
|
-
- test/dummy/config/boot.rb
|
156
|
-
- test/dummy/config/secrets.yml
|
157
|
-
- test/dummy/config/database.yml
|
158
|
-
- test/dummy/config/environments/test.rb
|
159
|
-
- test/dummy/config/environments/development.rb
|
160
|
-
- test/dummy/config/environments/production.rb
|
161
|
-
- test/dummy/config/routes.rb
|
162
|
-
- test/dummy/public/422.html
|
163
|
-
- test/dummy/public/500.html
|
164
|
-
- test/dummy/public/favicon.ico
|
165
|
-
- test/dummy/public/404.html
|
166
|
-
- test/dummy/README.rdoc
|
167
|
-
- test/test_helper.rb
|
168
|
-
- test/helpers/posts_helper_test.rb
|
169
|
-
- test/fixtures/posts.yml
|
170
|
-
- test/sample_test.rb
|
171
|
-
- test/controllers/posts_controller_test.rb
|
172
|
-
- test/integration/navigation_test.rb
|
101
|
+
test_files: []
|