-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added User, Team, and Captain models to admin
- Loading branch information
Showing
5 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ActiveAdmin.register Captain do | ||
# See permitted parameters documentation: | ||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters | ||
# | ||
# permit_params :list, :of, :attributes, :on, :model | ||
# | ||
# or | ||
# | ||
# permit_params do | ||
# permitted = [:permitted, :attributes] | ||
# permitted << :other if params[:action] == 'create' && current_user.admin? | ||
# permitted | ||
# end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ActiveAdmin.register Team do | ||
# See permitted parameters documentation: | ||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters | ||
# | ||
# permit_params :list, :of, :attributes, :on, :model | ||
# | ||
# or | ||
# | ||
# permit_params do | ||
# permitted = [:permitted, :attributes] | ||
# permitted << :other if params[:action] == 'create' && current_user.admin? | ||
# permitted | ||
# end | ||
permit_params :name, :captain_id, :tent_type, :tent_number, :passcode | ||
|
||
index do | ||
column :name do |team| | ||
link_to team.name, admin_team_path(team) | ||
end | ||
column :captain do |team| | ||
link_to team.captain.user.name, admin_user_path(team.captain.user) | ||
end | ||
column :tent_type | ||
column :tent_number | ||
column :passcode | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
ActiveAdmin.register User do | ||
# See permitted parameters documentation: | ||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters | ||
# | ||
# permit_params :list, :of, :attributes, :on, :model | ||
# | ||
# or | ||
# | ||
# permit_params do | ||
# permitted = [:permitted, :attributes] | ||
# permitted << :other if params[:action] == 'create' && current_user.admin? | ||
# permitted | ||
# end | ||
permit_params :email, :name, :team_id, :sign_in_count | ||
|
||
index do | ||
column :name do |user| | ||
link_to user.name, admin_user_path(user) | ||
end | ||
column :email | ||
column :team do |user| | ||
link_to user.team.name, admin_team_path(user.team) | ||
end | ||
column :sign_in_count | ||
|
||
actions | ||
end | ||
|
||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters