implement players
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EuchreCamp
|
||||
module Actions
|
||||
module Players
|
||||
class Show < EuchreCamp::Action
|
||||
include Deps[ repo: 'repositories.players' ]
|
||||
|
||||
def handle(request, response)
|
||||
requested_player = request.params[:id]
|
||||
player = repo.by_id(requested_player)
|
||||
response.render(view, player: player)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
<h1>EuchreCamp::Views::Players::Show</h1>
|
||||
|
||||
<h2><%= player.name %></h2>
|
||||
|
||||
<h3><%= player.rating %></h3>
|
||||
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EuchreCamp
|
||||
module Views
|
||||
module Players
|
||||
class Show < EuchreCamp::View
|
||||
expose :player
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user