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,21 @@
|
||||
class ProblemsController < ApplicationController
|
||||
before_action :set_problem, only: [:show]
|
||||
|
||||
def index
|
||||
@problems = Problem.paginate(page: params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_problem
|
||||
@problem = Problem.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def problem_params
|
||||
params.require(:problem)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user