phcdevworks_tutorials 2.1.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -27
- data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +1 -1
- data/app/models/phcdevworks_tutorials/tutorial/category.rb +1 -1
- data/app/models/phcdevworks_tutorials/tutorial/post.rb +1 -1
- data/app/views/layouts/phcdevworks_tutorials/application.html.erb +2 -2
- data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +1 -1
- data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +1 -1
- data/config/routes.rb +18 -18
- data/db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb +8 -0
- data/lib/phcdevworks_tutorials/version.rb +1 -1
- metadata +3 -3
- data/db/migrate/20191003235303_create_join_table_categories_posts.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73bfa6d1cf3e314aa938a5a67ce544c7899b2d56b19afcb0a147354216eb704
|
4
|
+
data.tar.gz: c8fa6aafa79e2504e5709718a727c44214ad5dba8acab50cf745eb7d7855c66e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 201a7c24fe3acd7d3f83648ce8e46da7c09ac03e90d700df9d34c50ca8178120b55a3892959c6dc529fb423bf493dc9ad58459f2cb021e2f2cabbec15460a610
|
7
|
+
data.tar.gz: 5b28edd1312dd7a228514e983968730ad52b79daa7bb0b4a35ecf159d1ee654ca97f8fec2ae7dc168f6ca961a55bfd1a6b4e26a90d1425e98a35b35b4f52f5ff
|
data/README.md
CHANGED
@@ -1,28 +1 @@
|
|
1
1
|
# PhcdevworksTutorials
|
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 'phcdevworks_tutorials'
|
12
|
-
```
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
```bash
|
16
|
-
$ bundle
|
17
|
-
```
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
```bash
|
21
|
-
$ gem install phcdevworks_tutorials
|
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).
|
@@ -74,7 +74,7 @@ module PhcdevworksTutorials
|
|
74
74
|
|
75
75
|
# Whitelist
|
76
76
|
def tutorial_post_params
|
77
|
-
params.require(:tutorial_post).permit(:tutorial_post_title, :tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id)
|
77
|
+
params.require(:tutorial_post).permit(:tutorial_post_title, :tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id, category_ids: [])
|
78
78
|
end
|
79
79
|
|
80
80
|
end
|
@@ -5,7 +5,7 @@ module PhcdevworksTutorials
|
|
5
5
|
extend FriendlyId
|
6
6
|
|
7
7
|
#Relationships
|
8
|
-
has_and_belongs_to_many :posts, class_name:
|
8
|
+
has_and_belongs_to_many :posts, class_name: "Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
|
9
9
|
|
10
10
|
# Form Fields Validation
|
11
11
|
validates :tutorial_category_name,
|
@@ -8,7 +8,7 @@ module PhcdevworksTutorials
|
|
8
8
|
has_one_attached :tutorial_post_image
|
9
9
|
|
10
10
|
# Relationships
|
11
|
-
has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "
|
11
|
+
has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
|
12
12
|
has_many :steps, class_name: "Tutorial::Step"
|
13
13
|
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
14
14
|
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<head>
|
4
4
|
|
5
5
|
<!-- SEO System -->
|
6
|
-
<% phc_seo_title "PHCDevworks
|
7
|
-
<% phc_seo_description "Ruby on Rails 6
|
6
|
+
<% phc_seo_title "PHCDevworks Tutorials" %>
|
7
|
+
<% phc_seo_description "Ruby on Rails 6 Engine to Manage Online Tutorials." %>
|
8
8
|
<!-- SEO System -->
|
9
9
|
|
10
10
|
<!-- SEO and Site Description -->
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
<div class="form-group field_with_errors">
|
20
20
|
<%= form.label :tutorial_post_status, "Tutorial Status" %>
|
21
|
-
<%= form.select( :tutorial_post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control
|
21
|
+
<%= form.select( :tutorial_post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control"}) %>
|
22
22
|
</div>
|
23
23
|
|
24
24
|
<div class="form-group field_with_errors">
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<tr>
|
51
51
|
<td><%= tutorial_post.tutorial_post_title %></td>
|
52
52
|
<td><%= tutorial_post.tutorial_post_description %></td>
|
53
|
-
<td><%= tutorial_post.tutorial_post_status %></td>
|
53
|
+
<td><%= tutorial_post.tutorial_post_status.capitalize %></td>
|
54
54
|
<td>
|
55
55
|
<div class="btn-group d-flex" role="group">
|
56
56
|
<%= link_to "Tutorial Details", tutorial_post, class: "btn btn-purple btn-xs" %>
|
data/config/routes.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
PhcdevworksTutorials::Engine.routes.draw do
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
end
|
8
|
-
resources :categories, class_name: "Tutorial::Category"
|
3
|
+
# Tutorial Routs
|
4
|
+
namespace :tutorial do
|
5
|
+
resources :posts, class_name: "Tutorial::Post" do
|
6
|
+
resources :steps, class_name: "Tutorial::Step"
|
9
7
|
end
|
8
|
+
resources :categories, class_name: "Tutorial::Category"
|
9
|
+
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
# Frontend Routes
|
12
|
+
namespace :blog do
|
13
|
+
resources :tutorials, only: [:index, :show]
|
14
|
+
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
16
|
+
# API Routes
|
17
|
+
namespace :api, :path => "", :constraints => {:subdomain => "tutorial_api"} do
|
18
|
+
namespace :v1 do
|
19
|
+
resources :posts, defaults: {format: "json"}
|
20
|
+
resources :categories, defaults: {format: "json"}
|
22
21
|
end
|
22
|
+
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
# Mount Routes
|
25
|
+
mount PhcdevworksAccounts::Engine, :at => "/"
|
26
26
|
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_tutorials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -301,10 +301,10 @@ files:
|
|
301
301
|
- app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
|
302
302
|
- app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
|
303
303
|
- config/routes.rb
|
304
|
-
- db/migrate/20191003235303_create_join_table_categories_posts.rb
|
305
304
|
- db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb
|
306
305
|
- db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb
|
307
306
|
- db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb
|
307
|
+
- db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb
|
308
308
|
- lib/phcdevworks_tutorials.rb
|
309
309
|
- lib/phcdevworks_tutorials/engine.rb
|
310
310
|
- lib/phcdevworks_tutorials/version.rb
|