Skip to content

Commit 9bc1d9b

Browse files
committed
tweaking
1 parent 0ecf043 commit 9bc1d9b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Nova
22
class ApplicationController < ActionController::Base
3+
include Pundit::Authorization
34
layout "nova_host_wrapped"
45
end
56
end

app/models/nova/contributor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class Contributor < ApplicationRecord
3333
include ValidationMessages
3434
include Identifiable
3535

36+
self.table_name = 'contributors'
37+
3638
# ================
3739
# = Associations =
3840
# ================

config/routes.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
Nova::Engine.routes.draw do
2-
resources :plans do
3-
resources :contributors, except: %i[show], to: "nova/contributors"
4-
end
2+
# contributor routes nested under plans, handled by Nova::ContributorsController
3+
# get "/plans/:plan_id/contributors", to: "contributors#index", as: :plan_contributors
4+
#get "/plans/:plan_id/contributors/new", to: "contributors#new", as: :new_plan_contributor
5+
post "/plans/:plan_id/contributors", to: "contributors#create"
6+
get "/plans/:plan_id/contributors/:id/edit", to: "contributors#edit", as: :edit_plan_contributor
7+
patch "/plans/:plan_id/contributors/:id", to: "contributors#update"
8+
put "/plans/:plan_id/contributors/:id", to: "contributors#update"
9+
delete "/plans/:plan_id/contributors/:id", to: "contributors#destroy"
510

11+
# other engine-specific routes
612
get "orcid_records(/:orcid_id)", to: "nova/orcid_records#show"
713
end

0 commit comments

Comments
 (0)