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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2502868a47ca5fa52e7c060d59789d30a20019db
4
- data.tar.gz: e15f698cb7ee695a4282050019a25f04dc41096b
3
+ metadata.gz: 2e2b4cdddd13d46790df8f94c3e58edbf733a183
4
+ data.tar.gz: 92e20258d860aff497cddbb831a641904fd967d5
5
5
  SHA512:
6
- metadata.gz: c4a2d5bc5a837211226a89c0b877a57169c1a665d155a696542b9dae8ac9f06c75b400586ef0c70a35f62ac43ebbdecfa77db09f81f066618cdfa75dc84cde09
7
- data.tar.gz: 53d87d9986e85a683ee300193833b928841a0f17c2a0330f6f0864cd791069a17d53cede2c4d23523654f271685f955a458df06c6df12cd016647f7b00497ceb
6
+ metadata.gz: 3f0f30208a6868a4e8485309e7ae3a265e9ec77350850afe0cd4da3875033e25a9b5b579a87d8d5d4c76d04731265dd7ffc2d4d241ba332430a46a72e64d04d4
7
+ data.tar.gz: 4ec4983da0f336c235b96b2f9424bae4e5f325ab7c8dd0d7d65cd8e85158a3bd47bd43dc77c741cf9c0834171bc23dc8a12dbcdcf12c456ff12648642bfcd860
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the modules::connections controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -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,4 @@
1
+ module Phcpresspro
2
+ module Modules::ConnectionsHelper
3
+ end
4
+ end
@@ -1,4 +1,9 @@
1
1
  module Phcpresspro
2
- class Modules::Connection < ApplicationRecord
3
- end
2
+ class Modules::Connection < ApplicationRecord
3
+
4
+ # Relationships
5
+ belongs_to :post, class_name: 'Articles::Post'
6
+ belongs_to :category, class_name: 'Modules::Category'
7
+
8
+ end
4
9
  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,6 @@
1
+ <h1>Editing Modules Connection</h1>
2
+
3
+ <%= render 'form', modules_connection: @modules_connection %>
4
+
5
+ <%= link_to 'Show', @modules_connection %> |
6
+ <%= link_to 'Back', modules_connections_path %>
@@ -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 %>
@@ -0,0 +1,5 @@
1
+ <h1>New Modules Connection</h1>
2
+
3
+ <%= render 'form', modules_connection: @modules_connection %>
4
+
5
+ <%= link_to 'Back', modules_connections_path %>
@@ -0,0 +1,4 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <%= link_to 'Edit', edit_modules_connection_path(@modules_connection) %> |
4
+ <%= link_to 'Back', modules_connections_path %>
data/config/routes.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  Phcpresspro::Engine.routes.draw do
2
2
 
3
+ namespace :modules do
4
+ resources :connections
5
+ end
3
6
  # Article Routes
4
7
  namespace :articles do
5
8
  resources :posts
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Phcpresspro
2
- VERSION = "4.0.5"
2
+ VERSION = "4.0.6"
3
3
  end
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.5
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/20160719194145_create_phcpresspro_modules_connections.rb
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