Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは私はrubyで一時ファイルイメージ(png)を作成する方法を知りたいのですが、tempfileはランダムなファイル名しか取得できませんが、拡張子ファイルはありません。
ドキュメントをチェックしてください!
# Use the Array form to enforce an extension in the filename: file = Tempfile.new(['hello', '.jpg']) file.path # => something like: "/tmp/foo2843-8392-92849382--0.jpg"