Skip to content

Commit

Permalink
Support for POST requests in Rack
Browse files Browse the repository at this point in the history
  • Loading branch information
levkk committed Nov 7, 2024
1 parent 4fe58a6 commit f0cde0b
Show file tree
Hide file tree
Showing 11 changed files with 640 additions and 2 deletions.
9 changes: 9 additions & 0 deletions examples/rails/todo/app/controllers/todo_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class TodoController < ApplicationController
skip_before_action :verify_authenticity_token

def create
puts params
puts params[:hello]
redirect_to "/"
end
end
2 changes: 2 additions & 0 deletions examples/rails/todo/app/helpers/todo_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module TodoHelper
end
2 changes: 2 additions & 0 deletions examples/rails/todo/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
get "manifest" => "rails/pwa#manifest", as: :pwa_manifest

resources :todo

# Defines the root path route ("/")
# root "posts#index"
end
7 changes: 7 additions & 0 deletions examples/rails/todo/test/controllers/todo_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "test_helper"

class TodoControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
Loading

0 comments on commit f0cde0b

Please sign in to comment.