initial commit

This commit is contained in:
Senad Uka
2013-12-09 03:23:49 +01:00
parent 9582c13e0c
commit e8751fa215
204 changed files with 6675 additions and 41 deletions

View File

@@ -0,0 +1,25 @@
<%= form_for(@result) do |f| %>
<% if @result.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@result.errors.count, "error") %> prohibited this result from being saved:</h2>
<ul>
<% @result.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user_id %><br>
<%= f.number_field :user_id %>
</div>
<div class="field">
<%= f.label :time %><br>
<%= f.text_field :time %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing result</h1>
<%= render 'form' %>
<%= link_to 'Show', @result %> |
<%= link_to 'Back', results_path %>

View File

@@ -0,0 +1,29 @@
<h1>Listing results</h1>
<table>
<thead>
<tr>
<th>User</th>
<th>Time</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @results.each do |result| %>
<tr>
<td><%= result.user_id %></td>
<td><%= result.time %></td>
<td><%= link_to 'Show', result %></td>
<td><%= link_to 'Edit', edit_result_path(result) %></td>
<td><%= link_to 'Destroy', result, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Result', new_result_path %>

View File

@@ -0,0 +1,4 @@
json.array!(@results) do |result|
json.extract! result, :user_id, :time
json.url result_url(result, format: :json)
end

View File

@@ -0,0 +1,5 @@
<h1>New result</h1>
<%= render 'form' %>
<%= link_to 'Back', results_path %>

View File

@@ -0,0 +1,14 @@
<p id="notice"><%= notice %></p>
<p>
<strong>User:</strong>
<%= @result.user_id %>
</p>
<p>
<strong>Time:</strong>
<%= @result.time %>
</p>
<%= link_to 'Edit', edit_result_path(@result) %> |
<%= link_to 'Back', results_path %>

View File

@@ -0,0 +1 @@
json.extract! @result, :user_id, :time, :created_at, :updated_at