diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-03 23:06:47 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-03 23:06:47 -0500 |
commit | 8b526eadfcb024a5e8ead4c5b63eacb554db0cf5 (patch) | |
tree | c96e10e0e0e48154430a4d733c6385433dbe2739 /app/views/tournaments | |
parent | 3c9da1eee130d49f998016f8bad91f97f8bdf100 (diff) | |
parent | 423d0e5a440d8d66407522bc842ef273196173bc (diff) |
Merge branch 'clean4'
Conflicts:
app/assets/stylesheets/scaffolds.css.scss
app/assets/stylesheets/static.css.scss
app/controllers/sessions_controller.rb
app/controllers/static_controller.rb
app/controllers/tournaments_controller.rb
app/controllers/users_controller.rb
app/helpers/sessions_helper.rb
app/models/game.rb
app/models/user.rb
app/views/games/index.html.erb
app/views/tournaments/index.html.erb
app/views/tournaments/new.html.erb
app/views/users/_form.html.erb
app/views/users/index.html.erb
app/views/users/index.json.jbuilder
app/views/users/new.html.erb
app/views/users/show.html.erb
app/views/users/show.json.jbuilder
config/routes.rb
generate.sh
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_form.html.erb | 21 | ||||
-rw-r--r-- | app/views/tournaments/edit.html.erb | 6 | ||||
-rw-r--r-- | app/views/tournaments/index.json.jbuilder | 4 | ||||
-rw-r--r-- | app/views/tournaments/new.html.erb | 1 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 9 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 1 |
6 files changed, 41 insertions, 1 deletions
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb new file mode 100644 index 0000000..1fd63e9 --- /dev/null +++ b/app/views/tournaments/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@tournament) do |f| %> + <% if @tournament.errors.any? %> + <div id="error_explanation"> + <h2><%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:</h2> + + <ul> + <% @tournament.errors.full_messages.each do |msg| %> + <li><%= msg %></li> + <% end %> + </ul> + </div> + <% end %> + + <div class="field"> + <%= f.label :game_id %><br> + <%= f.text_field :game_id %> + </div> + <div class="actions"> + <%= f.submit %> + </div> +<% end %> diff --git a/app/views/tournaments/edit.html.erb b/app/views/tournaments/edit.html.erb new file mode 100644 index 0000000..2913025 --- /dev/null +++ b/app/views/tournaments/edit.html.erb @@ -0,0 +1,6 @@ +<h1>Editing tournament</h1> + +<%= render 'form' %> + +<%= link_to 'Show', @tournament %> | +<%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder new file mode 100644 index 0000000..e6f3b49 --- /dev/null +++ b/app/views/tournaments/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@tournaments) do |tournament| + json.extract! tournament, :id, :game_id + json.url tournament_url(tournament, format: :json) +end diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index a47f643..f1dec90 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -8,5 +8,4 @@ </div> <br /><br /> - <%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb new file mode 100644 index 0000000..30df788 --- /dev/null +++ b/app/views/tournaments/show.html.erb @@ -0,0 +1,9 @@ +<p id="notice"><%= notice %></p> + +<p> + <strong>Game:</strong> + <%= @tournament.game %> +</p> + +<%= link_to 'Edit', edit_tournament_path(@tournament) %> | +<%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder new file mode 100644 index 0000000..0fe65a6 --- /dev/null +++ b/app/views/tournaments/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @tournament, :id, :game_id, :created_at, :updated_at |