0
0

More than 1 year has passed since last update.

#Rails で options リクエストに対して ルーティングする例

Last updated at Posted at 2019-11-13

注意

OPTIONS request の役割とか考えてない例

routes.rb

こんなん

Rails.application.routes.draw do
  root to: 'roots#main', via: :options

controller

class RootsController < ApplicationController
  def main
    head 200
  end
end

curl で確認

curl -s -v -X OPTIONS http://localhost:3000/ 

rspec

ちなみに rspec で options のリクエストをする方法がわからんとです。

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0