URI.parse(request.url).query.present?
上のコードでクエリの存在確認できます
ex
URI.parse("https://teratail.com/questions/search?q=ruby&conditions=and").query.present?
true
URI.parse("https://teratail.com/questions/search").query.present?
false
もっと良いやり方や他の方法はないでしょうか?(Rubyだけでできたり、短いコードだったり)

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/31 02:00 編集
2018/07/31 03:22
2018/07/31 09:43