Refactor app in to its own slice
This commit is contained in:
16
slices/main/actions/pages/show.rb
Normal file
16
slices/main/actions/pages/show.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module Main
|
||||
module Actions
|
||||
module Pages
|
||||
class Show < Action
|
||||
include Deps["views.pages.show"]
|
||||
|
||||
def handle(req, res)
|
||||
slug = req.params[:slug]
|
||||
|
||||
res.status = File.exist?("slices/main/content/pages/#{slug}.md") ? 200 : 404
|
||||
res.render show, slug: slug
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user