mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-11-23 19:33:46 +01:00
Add controller for Problems with index and show actions
This commit is contained in:
1 parent
d1470f391e
commit
06ab2e4cab
11 files changed
+94
-2
No files matched your search
@@ -0,0 +1 @@
|
||||
<%= will_paginate @problems, renderer: BootstrapPagination::Rails %>
|
||||
@@ -0,0 +1,22 @@
|
||||
<h1>Listing Problems</h1>
|
||||
|
||||
<%= render 'problem_pagination' %>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @problems.each do |problem| %>
|
||||
<tr>
|
||||
<td><%= problem.id %></td>
|
||||
<td><%= link_to problem.title, problem %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= render 'problem_pagination' %>
|
||||
<br>
|
||||
@@ -0,0 +1,16 @@
|
||||
<% if notice %>
|
||||
<p id="notice"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= @problem.title %> <small>Problem <%= @problem.id %></small></h1>
|
||||
</div>
|
||||
|
||||
<%= panel do %>
|
||||
<div class="panel-body problem-content">
|
||||
<%= sanitize @problem.content %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="text-center">
|
||||
<%= link_to 'Dieses Problem auf projecteuler.net', @problem.translation.original_url, target: '_blank' %>
|
||||
</div>
|
||||
Reference in new issue
Block a user