From 96b97d691f6889004c38bef15411bc27e448fda1 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 18 Feb 2014 20:42:51 -0500 Subject: Changes to generate.sh --- app/assets/javascripts/alerts.js.coffee | 3 ++ app/assets/javascripts/main.js.coffee | 3 ++ app/assets/javascripts/pms.js.coffee | 3 ++ app/assets/javascripts/search.js.coffee | 3 ++ app/assets/stylesheets/alerts.css.scss | 3 ++ app/assets/stylesheets/main.css.scss | 3 ++ app/assets/stylesheets/pms.css.scss | 3 ++ app/assets/stylesheets/search.css.scss | 3 ++ app/controllers/alerts_controller.rb | 74 +++++++++++++++++++++++++++++++++ app/controllers/main_controller.rb | 2 + app/controllers/matches_controller.rb | 2 +- app/controllers/pms_controller.rb | 74 +++++++++++++++++++++++++++++++++ app/controllers/search_controller.rb | 2 + app/controllers/users_controller.rb | 2 +- app/helpers/alerts_helper.rb | 2 + app/helpers/main_helper.rb | 2 + app/helpers/pms_helper.rb | 2 + app/helpers/search_helper.rb | 2 + app/models/alert.rb | 2 + app/models/pm.rb | 2 + app/models/server_settings.rb | 2 + app/models/team_match_pair.rb | 2 + app/models/user_team_pair.rb | 2 + app/views/alerts/_form.html.erb | 25 +++++++++++ app/views/alerts/edit.html.erb | 6 +++ app/views/alerts/index.html.erb | 29 +++++++++++++ app/views/alerts/index.json.jbuilder | 4 ++ app/views/alerts/new.html.erb | 5 +++ app/views/alerts/show.html.erb | 14 +++++++ app/views/alerts/show.json.jbuilder | 1 + app/views/matches/_form.html.erb | 4 ++ app/views/matches/index.html.erb | 2 + app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.html.erb | 5 +++ app/views/matches/show.json.jbuilder | 2 +- app/views/pms/_form.html.erb | 29 +++++++++++++ app/views/pms/edit.html.erb | 6 +++ app/views/pms/index.html.erb | 31 ++++++++++++++ app/views/pms/index.json.jbuilder | 4 ++ app/views/pms/new.html.erb | 5 +++ app/views/pms/show.html.erb | 19 +++++++++ app/views/pms/show.json.jbuilder | 1 + app/views/users/_form.html.erb | 12 ++++++ app/views/users/index.html.erb | 6 +++ app/views/users/index.json.jbuilder | 2 +- app/views/users/show.html.erb | 15 +++++++ app/views/users/show.json.jbuilder | 2 +- 47 files changed, 423 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/alerts.js.coffee create mode 100644 app/assets/javascripts/main.js.coffee create mode 100644 app/assets/javascripts/pms.js.coffee create mode 100644 app/assets/javascripts/search.js.coffee create mode 100644 app/assets/stylesheets/alerts.css.scss create mode 100644 app/assets/stylesheets/main.css.scss create mode 100644 app/assets/stylesheets/pms.css.scss create mode 100644 app/assets/stylesheets/search.css.scss create mode 100644 app/controllers/alerts_controller.rb create mode 100644 app/controllers/main_controller.rb create mode 100644 app/controllers/pms_controller.rb create mode 100644 app/controllers/search_controller.rb create mode 100644 app/helpers/alerts_helper.rb create mode 100644 app/helpers/main_helper.rb create mode 100644 app/helpers/pms_helper.rb create mode 100644 app/helpers/search_helper.rb create mode 100644 app/models/alert.rb create mode 100644 app/models/pm.rb create mode 100644 app/models/server_settings.rb create mode 100644 app/models/team_match_pair.rb create mode 100644 app/models/user_team_pair.rb create mode 100644 app/views/alerts/_form.html.erb create mode 100644 app/views/alerts/edit.html.erb create mode 100644 app/views/alerts/index.html.erb create mode 100644 app/views/alerts/index.json.jbuilder create mode 100644 app/views/alerts/new.html.erb create mode 100644 app/views/alerts/show.html.erb create mode 100644 app/views/alerts/show.json.jbuilder create mode 100644 app/views/pms/_form.html.erb create mode 100644 app/views/pms/edit.html.erb create mode 100644 app/views/pms/index.html.erb create mode 100644 app/views/pms/index.json.jbuilder create mode 100644 app/views/pms/new.html.erb create mode 100644 app/views/pms/show.html.erb create mode 100644 app/views/pms/show.json.jbuilder (limited to 'app') diff --git a/app/assets/javascripts/alerts.js.coffee b/app/assets/javascripts/alerts.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/alerts.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/main.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/pms.js.coffee b/app/assets/javascripts/pms.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/pms.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/search.js.coffee b/app/assets/javascripts/search.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/search.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/alerts.css.scss b/app/assets/stylesheets/alerts.css.scss new file mode 100644 index 0000000..c01a620 --- /dev/null +++ b/app/assets/stylesheets/alerts.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the alerts controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/main.css.scss b/app/assets/stylesheets/main.css.scss new file mode 100644 index 0000000..a0d94c1 --- /dev/null +++ b/app/assets/stylesheets/main.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the main controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/pms.css.scss b/app/assets/stylesheets/pms.css.scss new file mode 100644 index 0000000..5106093 --- /dev/null +++ b/app/assets/stylesheets/pms.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the pms controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/search.css.scss b/app/assets/stylesheets/search.css.scss new file mode 100644 index 0000000..22fd394 --- /dev/null +++ b/app/assets/stylesheets/search.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the search controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb new file mode 100644 index 0000000..e6158f4 --- /dev/null +++ b/app/controllers/alerts_controller.rb @@ -0,0 +1,74 @@ +class AlertsController < ApplicationController + before_action :set_alert, only: [:show, :edit, :update, :destroy] + + # GET /alerts + # GET /alerts.json + def index + @alerts = Alert.all + end + + # GET /alerts/1 + # GET /alerts/1.json + def show + end + + # GET /alerts/new + def new + @alert = Alert.new + end + + # GET /alerts/1/edit + def edit + end + + # POST /alerts + # POST /alerts.json + def create + @alert = Alert.new(alert_params) + + respond_to do |format| + if @alert.save + format.html { redirect_to @alert, notice: 'Alert was successfully created.' } + format.json { render action: 'show', status: :created, location: @alert } + else + format.html { render action: 'new' } + format.json { render json: @alert.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /alerts/1 + # PATCH/PUT /alerts/1.json + def update + respond_to do |format| + if @alert.update(alert_params) + format.html { redirect_to @alert, notice: 'Alert was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @alert.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /alerts/1 + # DELETE /alerts/1.json + def destroy + @alert.destroy + respond_to do |format| + format.html { redirect_to alerts_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_alert + @alert = Alert.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def alert_params + params.require(:alert).permit(:author, :message) + end +end diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000..6519d7b --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,2 @@ +class MainController < ApplicationController +end diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 4c0c4e4..bb2a67a 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -69,6 +69,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params[:match] + params.require(:match).permit(:tournament) end end diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb new file mode 100644 index 0000000..6eb94f9 --- /dev/null +++ b/app/controllers/pms_controller.rb @@ -0,0 +1,74 @@ +class PmsController < ApplicationController + before_action :set_pm, only: [:show, :edit, :update, :destroy] + + # GET /pms + # GET /pms.json + def index + @pms = Pm.all + end + + # GET /pms/1 + # GET /pms/1.json + def show + end + + # GET /pms/new + def new + @pm = Pm.new + end + + # GET /pms/1/edit + def edit + end + + # POST /pms + # POST /pms.json + def create + @pm = Pm.new(pm_params) + + respond_to do |format| + if @pm.save + format.html { redirect_to @pm, notice: 'Pm was successfully created.' } + format.json { render action: 'show', status: :created, location: @pm } + else + format.html { render action: 'new' } + format.json { render json: @pm.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /pms/1 + # PATCH/PUT /pms/1.json + def update + respond_to do |format| + if @pm.update(pm_params) + format.html { redirect_to @pm, notice: 'Pm was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @pm.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /pms/1 + # DELETE /pms/1.json + def destroy + @pm.destroy + respond_to do |format| + format.html { redirect_to pms_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_pm + @pm = Pm.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def pm_params + params.require(:pm).permit(:author, :recipient, :message) + end +end diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb new file mode 100644 index 0000000..ee61487 --- /dev/null +++ b/app/controllers/search_controller.rb @@ -0,0 +1,2 @@ +class SearchController < ApplicationController +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index da49625..4db617e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -69,6 +69,6 @@ class UsersController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def user_params - params[:user] + params.require(:user).permit(:name, :pw_hash, :groups) end end diff --git a/app/helpers/alerts_helper.rb b/app/helpers/alerts_helper.rb new file mode 100644 index 0000000..20f5b50 --- /dev/null +++ b/app/helpers/alerts_helper.rb @@ -0,0 +1,2 @@ +module AlertsHelper +end diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb new file mode 100644 index 0000000..826effe --- /dev/null +++ b/app/helpers/main_helper.rb @@ -0,0 +1,2 @@ +module MainHelper +end diff --git a/app/helpers/pms_helper.rb b/app/helpers/pms_helper.rb new file mode 100644 index 0000000..0188e59 --- /dev/null +++ b/app/helpers/pms_helper.rb @@ -0,0 +1,2 @@ +module PmsHelper +end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb new file mode 100644 index 0000000..b3ce20a --- /dev/null +++ b/app/helpers/search_helper.rb @@ -0,0 +1,2 @@ +module SearchHelper +end diff --git a/app/models/alert.rb b/app/models/alert.rb new file mode 100644 index 0000000..e61a702 --- /dev/null +++ b/app/models/alert.rb @@ -0,0 +1,2 @@ +class Alert < ActiveRecord::Base +end diff --git a/app/models/pm.rb b/app/models/pm.rb new file mode 100644 index 0000000..24d6eb4 --- /dev/null +++ b/app/models/pm.rb @@ -0,0 +1,2 @@ +class Pm < ActiveRecord::Base +end diff --git a/app/models/server_settings.rb b/app/models/server_settings.rb new file mode 100644 index 0000000..7f49863 --- /dev/null +++ b/app/models/server_settings.rb @@ -0,0 +1,2 @@ +class ServerSettings < ActiveRecord::Base +end diff --git a/app/models/team_match_pair.rb b/app/models/team_match_pair.rb new file mode 100644 index 0000000..24a4e86 --- /dev/null +++ b/app/models/team_match_pair.rb @@ -0,0 +1,2 @@ +class TeamMatchPair < ActiveRecord::Base +end diff --git a/app/models/user_team_pair.rb b/app/models/user_team_pair.rb new file mode 100644 index 0000000..7694996 --- /dev/null +++ b/app/models/user_team_pair.rb @@ -0,0 +1,2 @@ +class UserTeamPair < ActiveRecord::Base +end diff --git a/app/views/alerts/_form.html.erb b/app/views/alerts/_form.html.erb new file mode 100644 index 0000000..f0da996 --- /dev/null +++ b/app/views/alerts/_form.html.erb @@ -0,0 +1,25 @@ +<%= form_for(@alert) do |f| %> + <% if @alert.errors.any? %> +
+

<%= pluralize(@alert.errors.count, "error") %> prohibited this alert from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :author %>
+ <%= f.text_field :author %> +
+
+ <%= f.label :message %>
+ <%= f.text_area :message %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/alerts/edit.html.erb b/app/views/alerts/edit.html.erb new file mode 100644 index 0000000..ad99164 --- /dev/null +++ b/app/views/alerts/edit.html.erb @@ -0,0 +1,6 @@ +

Editing alert

+ +<%= render 'form' %> + +<%= link_to 'Show', @alert %> | +<%= link_to 'Back', alerts_path %> diff --git a/app/views/alerts/index.html.erb b/app/views/alerts/index.html.erb new file mode 100644 index 0000000..458b951 --- /dev/null +++ b/app/views/alerts/index.html.erb @@ -0,0 +1,29 @@ +

Listing alerts

+ + + + + + + + + + + + + + <% @alerts.each do |alert| %> + + + + + + + + <% end %> + +
AuthorMessage
<%= alert.author %><%= alert.message %><%= link_to 'Show', alert %><%= link_to 'Edit', edit_alert_path(alert) %><%= link_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Alert', new_alert_path %> diff --git a/app/views/alerts/index.json.jbuilder b/app/views/alerts/index.json.jbuilder new file mode 100644 index 0000000..685157e --- /dev/null +++ b/app/views/alerts/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@alerts) do |alert| + json.extract! alert, :id, :author, :message + json.url alert_url(alert, format: :json) +end diff --git a/app/views/alerts/new.html.erb b/app/views/alerts/new.html.erb new file mode 100644 index 0000000..6d04589 --- /dev/null +++ b/app/views/alerts/new.html.erb @@ -0,0 +1,5 @@ +

New alert

+ +<%= render 'form' %> + +<%= link_to 'Back', alerts_path %> diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb new file mode 100644 index 0000000..eeab7f7 --- /dev/null +++ b/app/views/alerts/show.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

+ Author: + <%= @alert.author %> +

+ +

+ Message: + <%= @alert.message %> +

+ +<%= link_to 'Edit', edit_alert_path(@alert) %> | +<%= link_to 'Back', alerts_path %> diff --git a/app/views/alerts/show.json.jbuilder b/app/views/alerts/show.json.jbuilder new file mode 100644 index 0000000..83fe24a --- /dev/null +++ b/app/views/alerts/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @alert, :id, :author, :message, :created_at, :updated_at diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index c772c7f..7d0a371 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -11,6 +11,10 @@ <% end %> +
+ <%= f.label :tournament %>
+ <%= f.text_field :tournament %> +
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 22ae41e..d8122ac 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -3,6 +3,7 @@ + @@ -12,6 +13,7 @@ <% @matches.each do |match| %> + diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 08daa52..0839c83 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id + json.extract! match, :id, :tournament json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 453985b..7bab721 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,4 +1,9 @@

<%= notice %>

+

+ Tournament: + <%= @match.tournament %> +

+ <%= link_to 'Edit', edit_match_path(@match) %> | <%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index 7190e4c..a381f65 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :created_at, :updated_at +json.extract! @match, :id, :tournament, :created_at, :updated_at diff --git a/app/views/pms/_form.html.erb b/app/views/pms/_form.html.erb new file mode 100644 index 0000000..bbc6aee --- /dev/null +++ b/app/views/pms/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@pm) do |f| %> + <% if @pm.errors.any? %> +
+

<%= pluralize(@pm.errors.count, "error") %> prohibited this pm from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :author %>
+ <%= f.text_field :author %> +
+
+ <%= f.label :recipient %>
+ <%= f.text_field :recipient %> +
+
+ <%= f.label :message %>
+ <%= f.text_area :message %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/pms/edit.html.erb b/app/views/pms/edit.html.erb new file mode 100644 index 0000000..074a4fd --- /dev/null +++ b/app/views/pms/edit.html.erb @@ -0,0 +1,6 @@ +

Editing pm

+ +<%= render 'form' %> + +<%= link_to 'Show', @pm %> | +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb new file mode 100644 index 0000000..cb7fe4b --- /dev/null +++ b/app/views/pms/index.html.erb @@ -0,0 +1,31 @@ +

Listing pms

+ +
Tournament
<%= match.tournament %> <%= link_to 'Show', match %> <%= link_to 'Edit', edit_match_path(match) %> <%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %>
+ + + + + + + + + + + + + <% @pms.each do |pm| %> + + + + + + + + + <% end %> + +
AuthorRecipientMessage
<%= pm.author %><%= pm.recipient %><%= pm.message %><%= link_to 'Show', pm %><%= link_to 'Edit', edit_pm_path(pm) %><%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Pm', new_pm_path %> diff --git a/app/views/pms/index.json.jbuilder b/app/views/pms/index.json.jbuilder new file mode 100644 index 0000000..aebdc08 --- /dev/null +++ b/app/views/pms/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@pms) do |pm| + json.extract! pm, :id, :author, :recipient, :message + json.url pm_url(pm, format: :json) +end diff --git a/app/views/pms/new.html.erb b/app/views/pms/new.html.erb new file mode 100644 index 0000000..29e24ec --- /dev/null +++ b/app/views/pms/new.html.erb @@ -0,0 +1,5 @@ +

New pm

+ +<%= render 'form' %> + +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb new file mode 100644 index 0000000..5ee483f --- /dev/null +++ b/app/views/pms/show.html.erb @@ -0,0 +1,19 @@ +

<%= notice %>

+ +

+ Author: + <%= @pm.author %> +

+ +

+ Recipient: + <%= @pm.recipient %> +

+ +

+ Message: + <%= @pm.message %> +

+ +<%= link_to 'Edit', edit_pm_path(@pm) %> | +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.json.jbuilder b/app/views/pms/show.json.jbuilder new file mode 100644 index 0000000..651e78f --- /dev/null +++ b/app/views/pms/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @pm, :id, :author, :recipient, :message, :created_at, :updated_at diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 4835056..a7ead1b 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -11,6 +11,18 @@ <% end %> +
+ <%= f.label :name %>
+ <%= f.text_area :name %> +
+
+ <%= f.label :pw_hash %>
+ <%= f.text_field :pw_hash %> +
+
+ <%= f.label :groups %>
+ <%= f.text_field :groups %> +
<%= f.submit %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 24a2548..14739ae 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -3,6 +3,9 @@ + + + @@ -12,6 +15,9 @@ <% @users.each do |user| %> + + + diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder index 6684a9c..58c42c1 100644 --- a/app/views/users/index.json.jbuilder +++ b/app/views/users/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@users) do |user| - json.extract! user, :id + json.extract! user, :id, :name, :pw_hash, :groups json.url user_url(user, format: :json) end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 32abeb0..05150f5 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,4 +1,19 @@

<%= notice %>

+

+ Name: + <%= @user.name %> +

+ +

+ Pw hash: + <%= @user.pw_hash %> +

+ +

+ Groups: + <%= @user.groups %> +

+ <%= link_to 'Edit', edit_user_path(@user) %> | <%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder index 80ed63e..968b383 100644 --- a/app/views/users/show.json.jbuilder +++ b/app/views/users/show.json.jbuilder @@ -1 +1 @@ -json.extract! @user, :id, :created_at, :updated_at +json.extract! @user, :id, :name, :pw_hash, :groups, :created_at, :updated_at -- cgit v1.2.3
NamePw hashGroups
<%= user.name %><%= user.pw_hash %><%= user.groups %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>