diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-06 15:06:19 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-06 15:06:19 -0500 |
commit | 1178dea355bf88213f5b36fae8914af6385b341a (patch) | |
tree | d878f219336ba22350011eebf71434e35957953a /app/views | |
parent | 5bd262333beb533cc08f21f7398e3ed1e890a23d (diff) |
tournaments: fix game selection
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/tournaments/new.html.erb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 428487a..6c3fefc 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -1,19 +1,16 @@ -<%= javascript_include_tag :defaults %> - <h1>New Tournament</h1> -<%= select_tag 'tournament_id', options_for_select(["Select a Game Type"] + Game.all.collect {|game| game.name}), :onchange => 'populate()' %> <%= link_to 'Select', 'new?game=1', :class => "btn btn-warning btn-lg" %> - +<%= form_tag(new_tournament_path, method: "get") do %> + <%= select_tag('game', + options_from_collection_for_select(@games, 'id', 'name', @game.nil? || @game.id), + :prompt => "Select a Game Type") %> + <%= submit_tag("Select", :class => "btn-warning btn-lg") %> +<% end %> - -<br /> <div id='ajax-form'> - <% if not @game.nil? %> + <% unless @game.nil? %> <%= render 'selected' %> <% end %> </div> -<br /><br /> - -<%= link_to 'Select', 'selected', :class => "btn btn-warning btn-lg" %> <%= link_to 'Back', tournaments_path %> |