phcpresspro 4.0.5 → 4.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/phcpresspro/modules/connections.js +2 -0
- data/app/assets/stylesheets/phcpresspro/modules/connections.scss +3 -0
- data/app/controllers/phcpresspro/modules/connections_controller.rb +64 -0
- data/app/helpers/phcpresspro/modules/connections_helper.rb +4 -0
- data/app/models/phcpresspro/modules/connection.rb +7 -2
- data/app/views/phcpresspro/modules/connections/_form.html.erb +17 -0
- data/app/views/phcpresspro/modules/connections/edit.html.erb +6 -0
- data/app/views/phcpresspro/modules/connections/index.html.erb +25 -0
- data/app/views/phcpresspro/modules/connections/new.html.erb +5 -0
- data/app/views/phcpresspro/modules/connections/show.html.erb +4 -0
- data/config/routes.rb +3 -0
- data/db/migrate/{20160719194145_create_phcpresspro_modules_connections.rb → 20160719221205_create_phcpresspro_modules_connections.rb} +0 -7
- data/lib/phcpresspro/version.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e2b4cdddd13d46790df8f94c3e58edbf733a183
|
4
|
+
data.tar.gz: 92e20258d860aff497cddbb831a641904fd967d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f0f30208a6868a4e8485309e7ae3a265e9ec77350850afe0cd4da3875033e25a9b5b579a87d8d5d4c76d04731265dd7ffc2d4d241ba332430a46a72e64d04d4
|
7
|
+
data.tar.gz: 4ec4983da0f336c235b96b2f9424bae4e5f325ab7c8dd0d7d65cd8e85158a3bd47bd43dc77c741cf9c0834171bc23dc8a12dbcdcf12c456ff12648642bfcd860
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require_dependency "phcpresspro/application_controller"
|
2
|
+
|
3
|
+
module Phcpresspro
|
4
|
+
class Modules::ConnectionsController < ApplicationController
|
5
|
+
before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]
|
6
|
+
|
7
|
+
# GET /modules/connections
|
8
|
+
def index
|
9
|
+
@modules_connections = Modules::Connection.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /modules/connections/1
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /modules/connections/new
|
17
|
+
def new
|
18
|
+
@modules_connection = Modules::Connectionn.new
|
19
|
+
@modules_connection.posts.build
|
20
|
+
@modules_connection.categories.build
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /modules/connections/1/edit
|
24
|
+
def edit
|
25
|
+
end
|
26
|
+
|
27
|
+
# POST /modules/connections
|
28
|
+
def create
|
29
|
+
@modules_connection = Modules::Connection.new(modules_connection_params)
|
30
|
+
|
31
|
+
if @modules_connection.save
|
32
|
+
redirect_to @modules_connection, notice: 'Connection was successfully created.'
|
33
|
+
else
|
34
|
+
render :new
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# PATCH/PUT /modules/connections/1
|
39
|
+
def update
|
40
|
+
if @modules_connection.update(modules_connection_params)
|
41
|
+
redirect_to @modules_connection, notice: 'Connection was successfully updated.'
|
42
|
+
else
|
43
|
+
render :edit
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# DELETE /modules/connections/1
|
48
|
+
def destroy
|
49
|
+
@modules_connection.destroy
|
50
|
+
redirect_to modules_connections_url, notice: 'Connection was successfully destroyed.'
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
# Use callbacks to share common setup or constraints between actions.
|
55
|
+
def set_modules_connection
|
56
|
+
@modules_connection = Modules::Connection.find(params[:id])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Only allow a trusted parameter "white list" through.
|
60
|
+
def modules_connection_params
|
61
|
+
params.fetch(:modules_connection, {})
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_for(modules_connection) do |f| %>
|
2
|
+
<% if modules_connection.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(modules_connection.errors.count, "error") %> prohibited this modules_connection from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% modules_connection.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="actions">
|
15
|
+
<%= f.submit %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Modules Connections</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th colspan="3"></th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
|
12
|
+
<tbody>
|
13
|
+
<% @modules_connections.each do |modules_connection| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= link_to 'Show', modules_connection %></td>
|
16
|
+
<td><%= link_to 'Edit', edit_modules_connection_path(modules_connection) %></td>
|
17
|
+
<td><%= link_to 'Destroy', modules_connection, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<br>
|
24
|
+
|
25
|
+
<%= link_to 'New Modules Connection', new_modules_connection_path %>
|
data/config/routes.rb
CHANGED
@@ -2,14 +2,7 @@ class CreatePhcpressproModulesConnections < ActiveRecord::Migration[5.0]
|
|
2
2
|
def change
|
3
3
|
create_table :phcpresspro_modules_connections do |t|
|
4
4
|
|
5
|
-
# Article
|
6
|
-
t.references :post, index: true
|
7
|
-
|
8
|
-
# Modules
|
9
|
-
t.references :category, index: true
|
10
|
-
|
11
5
|
t.timestamps
|
12
|
-
|
13
6
|
end
|
14
7
|
end
|
15
8
|
end
|
data/lib/phcpresspro/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcpresspro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
@@ -533,13 +533,17 @@ files:
|
|
533
533
|
- Rakefile
|
534
534
|
- app/assets/config/phcpresspro_manifest.js
|
535
535
|
- app/assets/javascripts/phcpresspro/application.js
|
536
|
+
- app/assets/javascripts/phcpresspro/modules/connections.js
|
536
537
|
- app/assets/stylesheets/phcpresspro/_custom.scss
|
537
538
|
- app/assets/stylesheets/phcpresspro/application.scss
|
539
|
+
- app/assets/stylesheets/phcpresspro/modules/connections.scss
|
538
540
|
- app/assets/stylesheets/scaffolds.scss
|
539
541
|
- app/controllers/phcpresspro/application_controller.rb
|
540
542
|
- app/controllers/phcpresspro/articles/posts_controller.rb
|
541
543
|
- app/controllers/phcpresspro/modules/categories_controller.rb
|
544
|
+
- app/controllers/phcpresspro/modules/connections_controller.rb
|
542
545
|
- app/helpers/phcpresspro/application_helper.rb
|
546
|
+
- app/helpers/phcpresspro/modules/connections_helper.rb
|
543
547
|
- app/jobs/phcpresspro/application_job.rb
|
544
548
|
- app/mailers/phcpresspro/application_mailer.rb
|
545
549
|
- app/models/phcpresspro/application_record.rb
|
@@ -561,10 +565,15 @@ files:
|
|
561
565
|
- app/views/phcpresspro/modules/categories/edit.html.erb
|
562
566
|
- app/views/phcpresspro/modules/categories/index.html.erb
|
563
567
|
- app/views/phcpresspro/modules/categories/new.html.erb
|
568
|
+
- app/views/phcpresspro/modules/connections/_form.html.erb
|
569
|
+
- app/views/phcpresspro/modules/connections/edit.html.erb
|
570
|
+
- app/views/phcpresspro/modules/connections/index.html.erb
|
571
|
+
- app/views/phcpresspro/modules/connections/new.html.erb
|
572
|
+
- app/views/phcpresspro/modules/connections/show.html.erb
|
564
573
|
- config/routes.rb
|
565
574
|
- db/migrate/20160716182936_create_phcpresspro_modules_categories.rb
|
566
575
|
- db/migrate/20160718204718_create_phcpresspro_articles_posts.rb
|
567
|
-
- db/migrate/
|
576
|
+
- db/migrate/20160719221205_create_phcpresspro_modules_connections.rb
|
568
577
|
- lib/phcpresspro.rb
|
569
578
|
- lib/phcpresspro/engine.rb
|
570
579
|
- lib/phcpresspro/version.rb
|