z, ? | toggle help (this) |
space, → | next slide |
shift-space, ← | previous slide |
d | toggle debug mode |
## <ret> | go to slide # |
r | reload slides |
n | toggle notes |
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
# Matches:
# /employee/7
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
# Matches:
# /employee/7 # with remaining path ""
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
# Matches:
# /employee/7 # with remaining path ""
# /employee/7/name
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
# Matches:
# /employee/7 # with remaining path ""
# /employee/7/name # with remaining path "/name"
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
# Matches:
# /employee/7
# /employee/7/name
#
# Does Not Match:
# /vendor/9
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
# Matches:
# /employee/7
# /employee/7/name
#
# Does Not Match:
# /vendor/9
# /employee/name
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id| # 7
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # GET /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # POST /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # POST /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # POST /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # POST /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # POST /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r| # POST /employee/7/name
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee/:employee_id" do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee/:employee_id" do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee/:employee_id" do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :placeholder_string_matchers
plugin :error_handler
plugin :error_handler
plugin :default_headers
plugin :error_handler
plugin :default_headers
plugin :not_found
plugin :error_handler
plugin :default_headers
plugin :not_found
plugin :flash
plugin :error_handler
plugin :default_headers
plugin :not_found
plugin :flash
plugin :streaming
plugin :error_handler
plugin :default_headers
plugin :not_found
plugin :flash
plugin :streaming
plugin :middleware
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :multi_route
Roda.route do |r|
access_check!(r.ip)
r.multi_route
end
Roda.plugin :multi_route
Roda.route do |r|
access_check!(r.ip)
r.multi_route
end
Roda.route("employee") do
r.on Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
plugin :json
plugin :json
plugin :csrf
plugin :json
plugin :csrf
plugin :render_each
plugin :json
plugin :csrf
plugin :render_each
plugin :view_subdirs # now :view_options
plugin :json
plugin :csrf
plugin :render_each
plugin :view_subdirs # now :view_options
plugin :render, escape: true
route do |r|
r.get do
view('employee')
end
end
plugin :symbol_views
route do |r|
r.get do
:employee
end
end
plugin :caching
plugin :caching
plugin :chunked
plugin :caching
plugin :chunked
plugin :assets
plugin :mailer
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
class Mailer < Roda
plugin :mailer
plugin :render
plugin :symbol_views
# Mailer.sendmail("/employee/7/time_off")
Roda.route do |r|
r.on "employee", Integer do |employee_id|
no_mail! unless employee = Employee[employee_id]
from "app@example.com"
to employee.email
r.mail "time_off" do
subject "Time Off Request Approved"
:time_off
end
r.mail "expense_claim" do
subject "Expense Claim Approved"
:expense_claim
end
end
end
end
plugin :assets_preloading
plugin :assets_preloading
plugin :public
plugin :assets_preloading
plugin :public
plugin :path_rewriter
plugin :assets_preloading
plugin :public
plugin :path_rewriter
plugin :json_parser
plugin :assets_preloading
plugin :public
plugin :path_rewriter
plugin :json_parser
plugin :static_routing
plugin :assets_preloading
plugin :public
plugin :path_rewriter
plugin :json_parser
plugin :static_routing
plugin :type_routing
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :class_matchers
Roda.class_matcher Employee, Integer do |employee_id|
Employee[employee_id]
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Employee do |employee|
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :class_matchers
Roda.class_matcher Employee, Integer do |employee_id|
Employee[employee_id]
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Employee do |employee|
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :class_matchers
Roda.class_matcher Employee, Integer do |employee_id|
Employee[employee_id]
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Employee do |employee|
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :class_matchers
Roda.class_matcher Employee, Integer do |employee_id|
Employee[employee_id]
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Employee do |employee|
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :class_matchers
Roda.class_matcher Employee, Integer do |employee_id|
Employee[employee_id]
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Employee do |employee|
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
plugin :sessions
plugin :sessions
plugin :early_hints
plugin :sessions
plugin :early_hints
plugin :content_security_policy
plugin :sessions
plugin :early_hints
plugin :content_security_policy
plugin :mail_processor
plugin :sessions
plugin :early_hints
plugin :content_security_policy
plugin :mail_processor
plugin :common_logger
plugin :sessions
plugin :early_hints
plugin :content_security_policy
plugin :mail_processor
plugin :common_logger
plugin :exception_page
plugin :sessions
plugin :early_hints
plugin :content_security_policy
plugin :mail_processor
plugin :common_logger
plugin :exception_page
plugin :hash_routes
plugin :sessions
plugin :early_hints
plugin :content_security_policy
plugin :mail_processor
plugin :common_logger
plugin :exception_page
plugin :hash_routes
plugin :route_csrf
employee_id = typecast_params(:pos_int, "employee_id")
plugin :host_authorization
plugin :host_authorization
plugin :additional_render_engines
plugin :host_authorization
plugin :additional_render_engines
plugin :additional_view_directories
plugin :host_authorization
plugin :additional_render_engines
plugin :additional_view_directories
plugin :custom_matchers
plugin :host_authorization
plugin :additional_render_engines
plugin :additional_view_directories
plugin :custom_matchers
plugin :multi_public
plugin :host_authorization
plugin :additional_render_engines
plugin :additional_view_directories
plugin :custom_matchers
plugin :multi_public
plugin :hash_branches
plugin :host_authorization
plugin :additional_render_engines
plugin :additional_view_directories
plugin :custom_matchers
plugin :multi_public
plugin :hash_branches
plugin :hash_branch_view_subdir
plugin :custom_block_results
plugin :custom_block_results
plugin :autoload_hash_branches
plugin :custom_block_results
plugin :autoload_hash_branches
plugin :permissions_policy
plugin :custom_block_results
plugin :autoload_hash_branches
plugin :permissions_policy
plugin :cookie_flags
plugin :custom_block_results
plugin :autoload_hash_branches
plugin :permissions_policy
plugin :cookie_flags
plugin :invalid_request_body
plugin :custom_block_results
plugin :autoload_hash_branches
plugin :permissions_policy
plugin :cookie_flags
plugin :invalid_request_body
plugin :render_coverage
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.route do |r|
access_check!(r.ip)
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
Roda.plugin :hmac_paths, secret: ENV['SECRET']
Roda.route do |r|
access_check!(r.ip)
r.hmac_path do
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
end
Roda.plugin :hmac_paths, secret: ENV['SECRET']
# hmac_path("/employee/7")
Roda.route do |r|
access_check!(r.ip)
r.hmac_path do
r.on "employee", Integer do |employee_id|
next unless employee = Employee[employee_id]
r.is "name" do
r.get do
"Hello #{employee.name}"
end
r.post do
employee.update(name: r.params['name'])
r.redirect
end
end
end
end
end
plugin(
:public,
root: Karafka::Web.gem_root.join('lib/karafka/web/ui/public'),
headers: { 'Cache-Control' => 'max-age=31536000, immutable' },
gzip: true,
brotli: true
)
route do |r|
r.on 'assets', Karafka::Web::VERSION do
r.public
end
# ...
end
plugin :custom_block_results
handle_block_result Controllers::Responses::Render do |result|
render_response(result)
end
handle_block_result Controllers::Responses::Redirect do |result|
result.flashes.each { |key, value| flash[key] = value }
response.redirect result.back? ? request.referer : root_path(result.path)
end
handle_block_result Controllers::Responses::File do |result|
response.headers['Content-Type'] = 'application/octet-stream'
response.headers['Content-Disposition'] = "attachment; filename=\"#{result.file_name}\""
response.write result.content
end
plugin :rodauth do
enable :argon2, :change_login, :change_password, :close_account, :create_account,
:lockout, :login, :logout, :remember, :reset_password,
:disallow_password_reuse, :password_grace_period, :active_sessions,
:verify_login_change, :change_password_notify, :confirm_password,
:otp, :webauthn, :recovery_codes
# ...
end
plugin :rodauth do
enable :argon2, :change_login, :change_password, :close_account, :create_account,
:lockout, :login, :logout, :remember, :reset_password,
:disallow_password_reuse, :password_grace_period, :active_sessions,
:verify_login_change, :change_password_notify, :confirm_password,
:otp, :webauthn, :recovery_codes
# ...
end
plugin :rodauth do
enable :argon2, :change_login, :change_password, :close_account, :create_account,
:lockout, :login, :logout, :remember, :reset_password,
:disallow_password_reuse, :password_grace_period, :active_sessions,
:verify_login_change, :change_password_notify, :confirm_password,
:otp, :webauthn, :recovery_codes
# ...
end
plugin :rodauth do
enable :argon2, :change_login, :change_password, :close_account, :create_account,
:lockout, :login, :logout, :remember, :reset_password,
:disallow_password_reuse, :password_grace_period, :active_sessions,
:verify_login_change, :change_password_notify, :confirm_password,
:otp, :webauthn, :recovery_codes
# ...
end
plugin :rodauth, name: :api do
enable :argon2, :json, :jwt, :active_sessions, :login
# ...
end
r.public
r.assets
r.on "webhook" do
r.hash_branches(:webhook_prefix)
end
r.rodauth
check_csrf!
rodauth.load_memory
rodauth.check_active_session
r.root do
r.redirect rodauth.login_route
end
rodauth.require_authentication
r.hash_branches("")
r.public
r.assets
r.on "webhook" do
r.hash_branches(:webhook_prefix)
end
r.rodauth
check_csrf!
rodauth.load_memory
rodauth.check_active_session
r.root do
r.redirect rodauth.login_route
end
rodauth.require_authentication
r.hash_branches("")
r.public
r.assets
r.on "webhook" do
r.hash_branches(:webhook_prefix)
end
r.rodauth
check_csrf!
rodauth.load_memory
rodauth.check_active_session
r.root do
r.redirect rodauth.login_route
end
rodauth.require_authentication
r.hash_branches("")
r.public
r.assets
r.on "webhook" do
r.hash_branches(:webhook_prefix)
end
r.rodauth
check_csrf!
rodauth.load_memory
rodauth.check_active_session
r.root do
r.redirect rodauth.login_route
end
rodauth.require_authentication
r.hash_branches("")