diff options
author | guntasgrewal <guntasgrewal@gmail.com> | 2014-03-04 15:25:58 -0500 |
---|---|---|
committer | guntasgrewal <guntasgrewal@gmail.com> | 2014-03-04 15:25:58 -0500 |
commit | e4ae559d8189519586e044238196ee45b2a10c6b (patch) | |
tree | 3d4977292aa234ea93ce604095f13d50484250a1 /app/views/tournaments | |
parent | 2f450dd30bb210fdc4cb8899c72e6da945a163ba (diff) | |
parent | da95cb4f0f48731c2713c61f17b522b048647fd1 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts:
app/assets/stylesheets/scaffolds.css.scss
app/views/layouts/application.html.erb
db/migrate/20140304043618_create_servers.rb
db/migrate/20140304043622_create_matches.rb
db/migrate/20140304043631_create_games.rb
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 | 7 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 1 |
6 files changed, 39 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..0d9dd10 --- /dev/null +++ b/app/views/tournaments/show.html.erb @@ -0,0 +1,7 @@ +<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 |