diff --git a/app/views/contests/edit.html.erb b/app/views/contests/edit.html.erb deleted file mode 100644 --- a/app/views/contests/edit.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -
<%= f.label :name %> | -<%= f.text_field :name %> | -
<%= f.label :title %> | -<%= f.text_field :title %> | -
- | - <%= f.check_box :enabled %> - <%= f.label :enabled %> - | -
- <%= f.submit 'Update' %> -
-<% end %> - -<%= link_to 'Show', @contest %> | -<%= link_to 'Back', contests_path %> diff --git a/app/views/contests/edit.html.haml b/app/views/contests/edit.html.haml new file mode 100644 --- /dev/null +++ b/app/views/contests/edit.html.haml @@ -0,0 +1,20 @@ +%h1 Editing contest += form_for(@contest) do |f| + = f.error_messages + %table + %tr + %td= f.label :name + %td= f.text_field :name + %tr + %td= f.label :title + %td= f.text_field :title + %tr + %td + %td + = f.check_box :enabled + = f.label :enabled + %p + = f.submit 'Update' += link_to 'Show', @contest +| += link_to 'Back', contests_path diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb deleted file mode 100644 --- a/app/views/contests/index.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -Name | -Title | -Enabled | -|||
---|---|---|---|---|---|
<%= in_place_editor_field :contest, :name, {}, :rows => 1 %> | -<%= in_place_editor_field :contest, :title, {}, :rows => 1 %> | -<%= in_place_editor_field :contest, :enabled, {}, :rows => 1 %> | -<%= link_to 'Show', contest %> | -<%= link_to 'Edit', edit_contest_path(contest) %> | -<%= link_to 'Destroy', contest, :confirm => 'Are you sure?', :method => :delete %> | -
- <%= f.label :name %>
- <%= f.text_field :name %>
-
- <%= f.label :title %>
- <%= f.text_field :title %>
-
- <%= f.label :enabled %>
- <%= f.check_box :enabled %>
-
- <%= f.submit 'Create' %> -
-<% end %> - -<%= link_to 'Back', contests_path %> diff --git a/app/views/contests/new.html.haml b/app/views/contests/new.html.haml new file mode 100644 --- /dev/null +++ b/app/views/contests/new.html.haml @@ -0,0 +1,18 @@ +%h1 New contest += form_for(@contest) do |f| + = f.error_messages + %p + = f.label :name + %br/ + = f.text_field :name + %p + = f.label :title + %br/ + = f.text_field :title + %p + = f.label :enabled + %br/ + = f.check_box :enabled + %p + = f.submit 'Create' += link_to 'Back', contests_path diff --git a/app/views/contests/show.html.erb b/app/views/contests/show.html.erb deleted file mode 100644 --- a/app/views/contests/show.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -- Enabled: - <%=h @contest.enabled %> -
- - -<%= link_to 'Edit', edit_contest_path(@contest) %> | -<%= link_to 'Back', contests_path %> diff --git a/app/views/contests/show.html.haml b/app/views/contests/show.html.haml new file mode 100644 --- /dev/null +++ b/app/views/contests/show.html.haml @@ -0,0 +1,11 @@ +%h1 + Contest: #{h @contest.title} +.infobox + %b Go back to: + [#{link_to 'contest management', :controller => 'contest_management', :action => 'index'}] +%p + %b Enabled: + = h @contest.enabled += link_to 'Edit', edit_contest_path(@contest) +| += link_to 'Back', contests_path