{"id":183,"date":"2022-09-29T23:37:37","date_gmt":"2022-09-20T07:34:23","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/"},"modified":"2025-07-31T21:27:46","modified_gmt":"2025-07-31T12:27:46","slug":"rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/","title":{"rendered":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5"},"content":{"rendered":"<p>\u8457\u8005\u306f\u300cWrite for Donations\u30d7\u30ed\u30b0\u30e9\u30e0\u300d\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u5bc4\u4ed8\u3092\u53d7\u3051\u308b\u56e3\u4f53\u3068\u3057\u3066\u300cGirls Who Code\u300d\u3092\u9078\u3073\u307e\u3057\u305f\u3002<\/p>\n<h3>\u30a4\u30f3\u30c8\u30ed\u30c0\u30af\u30b7\u30e7\u30f3<\/h3>\n<p>Devise\uff08\u30c7\u30d0\u30a4\u30b9\uff09\u306f\u3001Ruby on Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5411\u3051\u306e\u8a8d\u8a3c\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002\u72ec\u81ea\u306b\u3059\u3079\u3066\u884c\u3046\u5fc5\u8981\u306a\u304f\u3001\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30ec\u30d9\u30eb\u306e\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002Devise\u306b\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u7ba1\u7406\u3084OmniAuth gem\u3092\u4f7f\u7528\u3057\u305f\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306eOAuth\u30b5\u30a4\u30f3\u30a4\u30f3\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u542b\u3080\u3001\u591a\u304f\u306e\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002Devise\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30ea\u30bb\u30c3\u30c8\u3001\u30b5\u30a4\u30f3\u30a4\u30f3\u56de\u6570\u3084\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306e\u8ffd\u8de1\u3001\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306e\u5b9a\u7fa9\u3001\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30ed\u30c3\u30af\u306a\u3069\u306e\u6a5f\u80fd\u306b\u5bfe\u3059\u308b\u7d44\u307f\u8fbc\u307f\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Devise\u306f\u3001\u30b8\u30a7\u30e0\u306e\u521d\u671f\u5316\u3068\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u6301\u3064\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u306e\u4f5c\u6210\u3060\u3051\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u975e\u5e38\u306b\u7c21\u5358\u306b\u3057\u307e\u3059\u3002\u3082\u3057\u3082\u30bc\u30ed\u304b\u3089\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u4f5c\u308a\u305f\u3044\u5834\u5408\u3001\u5e0c\u671b\u3059\u308b\u5168\u3066\u306e\u6a5f\u80fd\u306b\u5bfe\u3057\u3066\u30b3\u30fc\u30c9\u3068\u30c6\u30b9\u30c8\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u51e6\u7406\u3001\u30af\u30c3\u30ad\u30fc\u306e\u4fdd\u5b58\u3001\u30c7\u30fc\u30bf\u306e\u5b89\u5168\u6027\u306e\u5168\u3066\u306e\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9\u3092\u6271\u308f\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002Devise\u30b8\u30a7\u30e0\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3053\u308c\u3089\u3092\u5168\u3066\u81ea\u5206\u3067\u5bfe\u5fdc\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u3001\u4ee3\u308f\u308a\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u306b\u96c6\u4e2d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Rails\u3092\u4f7f\u7528\u3057\u3066\u6700\u5c0f\u9650\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001Devise\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3001\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5b8c\u4e86\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>A local development environment for Ruby on Rails. For Linux, you can follow our tutorial How To Install Ruby on Rails with rvm on Ubuntu 20.04 or use the rvm product docs for installing on Mac or Windows. You can also refer to the Ruby project docs to install Ruby directly in your system. To install the Rails gem, you can use the official Rails documentation. The Devise gem requires Ruby version 2.1.0 or greater; this tutorial was tested using Ruby version 3.0.2 and Rails version 7.0.3.<\/li>\n<li>Node.js installed on your machine. A few Rails features, such as the Asset Pipeline, depend on a JavaScript Runtime. Node.js provides this functionality. For Ubuntu, install Node.js using the official PPA, as explained in option 2 of How To Install Node.js on Ubuntu 20.04. For Mac OS, follow our guide How To Install Node.js and Create a Local Development Environment on MacOS.<\/li>\n<li>Familiarity with Ruby and the Ruby on Rails framework. You can check out the first few tutorials from our series Rails on Containers, or you can use the official Rails Guides.<\/li>\n<\/ul>\n<h2>\u30b9\u30c6\u30c3\u30d71 \u2014 \u65b0\u3057\u3044Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u65b0\u3057\u3044Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u4e0a\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u521d\u671f\u5316\u3059\u308b\u305f\u3081\u306b\u3001rails\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">rails new <mark>blog<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30ec\u30fc\u30eb\u30ba\u306e\u65b0\u3057\u3044\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e&#8221;blog&#8221;\u306e\u4e0b\u306b\u65b0\u3057\u3044\u30ec\u30fc\u30eb\u30ba\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u751f\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3068\u30d5\u30a9\u30eb\u30c0\u304c\u542b\u307e\u308c\u307e\u3059\u3002\u305d\u306e\u3046\u3061\u306e1\u3064\u304cGemfile\u3067\u3042\u308a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002Step 3\u306eDevise\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a\u3067\u3001Gemfile\u3092\u69cb\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1a\u300cgem\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\uff08cd blog\uff09\u3001bundle install\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001Gemfile\u306b\u30ea\u30b9\u30c8\u3055\u308c\u3066\u3044\u308b\u3059\u3079\u3066\u306egem\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/div>\n<\/div>\n<p>\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u304a\u6c17\u306b\u5165\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u304f\u3053\u3068\u3082\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u4f7f\u7528\u3057\u3066\u305d\u308c\u306b\u79fb\u52d5\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">cd<\/span> <mark>blog<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u59cb\u3081\u308b\u306b\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089rails server\u30b3\u30de\u30f3\u30c9\u3067\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token builtin class-name\">exec<\/span> rails server<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Rails\u306e\u958b\u767a\u7528\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002\u30d6\u30e9\u30a6\u30b6\u3067http:\/\/localhost:3000\u3092\u958b\u304f\u3068\u3001Rails\u306e\u30a6\u30a7\u30eb\u30ab\u30e0\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u3082\u3057\u4ee3\u66ff\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u6307\u5b9a\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001Rails\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u30dd\u30fc\u30c83000\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\n<p>\u4ee5\u4e0b\u306e\u6587\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306b\u8868\u73fe\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4e00\u3064\u306e\u9078\u629e\u80a2\u3067\u7d50\u69cb\u3067\u3059\uff1a<\/p>\n<p>\u6ce8\u610f\uff1a\u30b3\u30de\u30f3\u30c9\u306e\u672b\u5c3e\u306b\u300cbundle exec\u300d\u3068\u8ffd\u52a0\u3059\u308b\u3068\u3001\u305d\u306e\u30b3\u30de\u30f3\u30c9\u306f\u73fe\u5728\u306e\u30d0\u30f3\u30c9\u30eb\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u56fa\u6709\u306eGemfile\u3068\u305d\u306e\u4e2d\u3067\u5b9a\u7fa9\u3055\u308c\u305fgem\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3060\u3051\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u540c\u3058gem\u306e\u7570\u306a\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<\/div>\n<\/div>\n<p>\u73fe\u5728\u65b0\u3057\u3044Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u521d\u671f\u5316\u3057\u307e\u3057\u305f\u3002\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Rails\u304c\u63d0\u4f9b\u3059\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u30ab\u30b9\u30bf\u30e0\u306e\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001Devise\u3092\u8ffd\u52a0\u3057\u305f\u5f8c\u306b\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u3088\u308a\u7c21\u5358\u306b\u30ca\u30d3\u30b2\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002\u65b0\u3057\u3044\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u305f\u5f8c\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3084\u30b5\u30a4\u30f3\u30a4\u30f3\u3059\u308b\u305f\u3081\u306e\u30ea\u30f3\u30af\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d7\uff12 \u2014 \u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306e\u4f5c\u6210<\/h2>\n<p>Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u57fa\u672c\u304c\u3067\u304d\u305f\u306e\u3067\u3001Rails\u304c\u63d0\u4f9b\u3059\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30da\u30fc\u30b8\u3092\u72ec\u81ea\u306e\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002\u30ab\u30b9\u30bf\u30e0\u306e\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8URL\u3067\u306e\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3068\u30b5\u30a4\u30f3\u30a4\u30f3\u306e\u30ea\u30f3\u30af\u3092\u8868\u793a\u3057\u3084\u3059\u304f\u3057\u307e\u3059\u3002\u5f8c\u306e\u624b\u9806\u3067\u3001\u30b5\u30a4\u30f3\u30a4\u30f3\u3068\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u306e\u30ea\u30f3\u30af\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>Add the route in the config\/routes.rb file.<\/li>\n<li>Create a HomeController which will handle the requests to this route.<\/li>\n<li>Create a view file to be rendered when you hit the route.<\/li>\n<\/ul>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u751f\u6210\u3055\u308c\u305froutes.rb\u30d5\u30a1\u30a4\u30eb\u306b\u30eb\u30fc\u30c8\u30d1\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u307e\u3059\u3002<\/p>\n<p>\u304a\u597d\u304d\u306a\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\uff08nano\u542b\u3080\uff09\u3092\u4f7f\u7528\u3057\u3066\u3001\u524d\u306b\u751f\u6210\u3055\u308c\u305fconfig\/routes.rb\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> config\/routes.rb<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305f\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u30021\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>config\/routes.rb \u2192 \u8a2d\u5b9a\u30eb\u30fc\u30c8.rb<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>Rails<span class=\"token punctuation\">.<\/span>application<span class=\"token punctuation\">.<\/span>routes<span class=\"token punctuation\">.<\/span>draw <span class=\"token keyword\">do<\/span>\r\n  <mark>root to<span class=\"token operator\">:<\/span> <span class=\"token string-literal\"><span class=\"token string\">\"home#index\"<\/span><\/span> <\/mark>\r\n<span class=\"token keyword\">end<\/span>\r\n<\/code><\/pre>\n<p>\u30eb\u30fc\u30c8\uff08root\uff09\uff1a\u30eb\u30fc\u30c8\u30d1\u30b9\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u30eb\u30fc\u30c8\u306fhttp:\/\/localhost:3000\u3067\u3042\u308a\u3001\u3053\u308c\u306fRails\u30a2\u30d7\u30ea\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30dd\u30fc\u30c8\u3067\u3059\u3002\u3053\u306e\u30eb\u30fc\u30c8\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u3001home\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306eindex\u30a2\u30af\u30b7\u30e7\u30f3\u3067\u51e6\u7406\u3055\u308c\u307e\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u6b21\u306bapp\/controllers\/home_controller.rb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>config\/routes.rb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u307e\u3059\u3002nano\u3092\u4f7f\u7528\u3057\u3066\u3001CTRL+X\u3067\u7d42\u4e86\u3057\u3001\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306bY\u3092\u62bc\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u78ba\u8a8d\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u969b\u306b\u306fENTER\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001app\/controllers\/home_controller.rb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u6b21\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u30a2\u30d7\u30ea\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u3042\u308bhome_controller.rb\u306b\u76f8\u5f53\u3059\u308b\u65e5\u672c\u8a9e\u306e\u8868\u73fe\u3092\u63d0\u4f9b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">class<\/span> <span class=\"token class-name\">HomeController<\/span> <span class=\"token operator\">&lt;<\/span> ApplicationController\r\n  <span class=\"token keyword\">def<\/span> <span class=\"token method-definition\"><span class=\"token function\">index<\/span><\/span>\r\n    render\r\n  <span class=\"token keyword\">end<\/span>\r\n<span class=\"token keyword\">end<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u308c\u306f\u57fa\u672c\u7684\u306aHomeController\u3067\u3001index\u30e1\u30bd\u30c3\u30c9\u304c1\u3064\u306e\u3053\u3068\u3092\u884c\u3044\u307e\u3059\uff1a\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u5834\u5408\u3001\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306fapp\/views\/home\/index.html.erb\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u3001app\/views\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306bhome\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30db\u30fc\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u308b\u3002<\/p>\n<p>\u6b21\u306b\u3001app\/views\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">mkdir<\/span> app\/views\/home\/<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u7279\u5b9a\u306eRails\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30d3\u30e5\u30fc\u306f\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u5f8c\u3001app\/views\/home\/index.html.erb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\u300capp\/views\/home\/index.html.erb\u300d\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u30021\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u63d0\u4f9b\u3057\u307e\u3059\uff1a<\/p>\n<p>\u300c\u30a2\u30d7\u30ea\/\u30d3\u30e5\u30fc\/\u30db\u30fc\u30e0\/\u30a4\u30f3\u30c7\u30c3\u30af\u30b9.html.erb\u300d<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&lt;<\/span>h1<span class=\"token operator\">&gt;<\/span>Hello Silicon Cloud<span class=\"token operator\">!<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>h1<span class=\"token operator\">&gt;<\/span>\r\n<\/code><\/pre>\n<p>app\/views\/home\/index.html.erb\u306f\u3001Home\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306eindex\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u3053\u3053\u3067\u306fRuby\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308bHTML\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u7279\u5b9a\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u305f\u30eb\u30fc\u30c8\u304c\u547c\u3073\u51fa\u3055\u308c\u308b\u3068\u3001\u3053\u306e\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u304c\u30e6\u30fc\u30b6\u30fc\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30eb\u30fc\u30c8URL\u306e\u5909\u66f4\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u3067http:\/\/localhost:3000\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\uff08\u65e2\u306b\u958b\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u30da\u30fc\u30b8\u3092\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\uff09\u3002\u66f4\u65b0\u3055\u308c\u305f\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656468ebdaa94e2bdf7b5130\/48-0.png\" alt=\"The home page of the application, rendering the index.html.erb file\" \/><\/div>\n<p>\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001\u3053\u306e\u30da\u30fc\u30b8\u3092\u3055\u3089\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3053\u308c\u3060\u3051\u3067\u5341\u5206\u3067\u3059\u3002<\/p>\n<p>\u7c21\u5358\u306aRails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u72ec\u81ea\u306e\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u3092\u6301\u3063\u3066\u3044\u308b\u306e\u3067\u3001Devise gem\u3092\u4f7f\u3063\u3066\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d73 \u2014 Devise\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Devise\u3092Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001gem\u306b\u4ed8\u5c5e\u3057\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u3068\u30d8\u30eb\u30d1\u30fc\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002user_signed_in?\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u30af\u30c3\u30ad\u30fc\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u307e\u305f\u3001current_user\u30d8\u30eb\u30d1\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u73fe\u5728\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8a73\u7d30\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u4e21\u65b9\u306e\u30e1\u30bd\u30c3\u30c9\u306fDevise\u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u304a\u308a\u3001\u4f59\u5206\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304b\u305a\u306b\u76f4\u63a5\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001Devise\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306eGitHub\u30da\u30fc\u30b8\u3067\u3055\u3089\u306b\u5b66\u3076\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Devise\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u6700\u521d\u306e\u624b\u9806\u306f\u3001Gemfile\u306bgem\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3059\u3002Gemfile\u306b\u306f\u3001Ruby\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u4f9d\u5b58\u95a2\u4fc2\u306b\u95a2\u3059\u308b\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u521d\u671f\u5316\u3059\u308b\u969b\u306b\u3001\u751f\u6210\u3055\u308c\u305fGemfile\u306b\u306f\u3001Rails\u306e\u5b9f\u884c\u306b\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u57fa\u672c\u7684\u306agem\u304c\u3059\u3067\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001Gemfile\u3092\u5909\u66f4\u3059\u308b\u524d\u306b\u3001\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u958b\u59cb\u3057\u305f\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u30bf\u30fc\u30df\u30ca\u30eb\u3067CTRL+C\u3092\u62bc\u3057\u3066\u505c\u6b62\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u305d\u306e\u5f8c\u3001\u7de8\u96c6\u306e\u305f\u3081\u306bGemfile\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002Devise\u306egem\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u306e\u65b9\u306b\u3001\u958b\u767a\u3068\u30c6\u30b9\u30c8\u306e\u30b0\u30eb\u30fc\u30d7\u306e\u5916\u5074\u306b\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305f\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u30b8\u30a7\u30e0\u30d5\u30a1\u30a4\u30eb<\/div>\n<pre class=\"post-pre\"><code>\r\n<span class=\"token comment\"># ...<\/span>\r\n\r\n<span class=\"token comment\"># Reduces boot times through caching; required in config\/boot.rb<\/span>\r\ngem <span class=\"token string-literal\"><span class=\"token string\">\"bootsnap\"<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">require<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">false<\/span>\r\n\r\n<span class=\"token comment\"># Use Active Storage variants [https:\/\/guides.rubyonrails.org\/active_storage_overview.html#transforming-images]<\/span>\r\n<span class=\"token comment\"># gem \"image_processing\", \"~&gt; 1.2\"<\/span>\r\n\r\n<mark>gem <span class=\"token string-literal\"><span class=\"token string\">\"devise\"<\/span><\/span> <\/mark>\r\n\r\ngroup <span class=\"token symbol\">:development<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">:test<\/span> <span class=\"token keyword\">do<\/span>\r\n  <span class=\"token comment\"># See https:\/\/guides.rubyonrails.org\/debugging_rails_applications.html#debugging-with-the-debug-gem<\/span>\r\n  gem <span class=\"token string-literal\"><span class=\"token string\">\"debug\"<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">platforms<\/span><span class=\"token operator\">:<\/span> <span class=\"token string-literal\"><span class=\"token string\">%i[ mri mingw x64_mingw ]<\/span><\/span>\r\n<span class=\"token keyword\">end<\/span>\r\n\r\n<span class=\"token comment\"># ...<\/span>\r\n<\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u30d0\u30f3\u30c9\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u65b0\u3057\u304f\u8ffd\u52a0\u3055\u308c\u305f\u30b8\u30a7\u30e0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u30d6\u30ed\u30b0\uff09\u304b\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token function\">install<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bDevise\u306egem\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001rails\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3067devise\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067Devise\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u306b\u306f\u3001\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token builtin class-name\">exec<\/span> rails g devise:install<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u306e\u300cg\u300d\u30d5\u30e9\u30b0\u306f\u3001\u751f\u6210\u3092\u8868\u3057\u3001Rails\u306e\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u547c\u3073\u51fa\u3059\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u306f\u3001\u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u3068\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002Rails\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u306b\u95a2\u3059\u308b\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001Rails\u30ac\u30a4\u30c9\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u524d\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u3068Devise\u5411\u3051\u306ei18n\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3080\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u3067\u8a73\u3057\u304f\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30a2\u30d7\u30ea\u3092\u6700\u521d\u306b\u8d77\u52d5\u3059\u308b\u969b\u306bDevise\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002i18n\u306f\u56fd\u969b\u5316\u3092\u610f\u5473\u3057\u3001\u30a2\u30d7\u30ea\u3092\u7570\u306a\u308b\u8a00\u8a9e\u3067\u5b9f\u884c\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u6a19\u6e96\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u6642\u70b9\u3067\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u6307\u793a\u3082\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>=============================================================================== Depending on your application&#8217;s configuration some manual setup may be required: 1. Ensure you have defined default url options in your environments files. Here is an example of default_url_options appropriate for a development environment in config\/environments\/development.rb: config.action_mailer.default_url_options = { host: &#8216;localhost&#8217;, port: 3000 } In production, :host should be set to the actual host of your application. * Required for all applications. * 2. Ensure you have defined root_url to *something* in your config\/routes.rb. For example: root to: &#8220;home#index&#8221; * Not required for API-only Applications * <mark>3. Ensure you have flash messages in app\/views\/layouts\/application.html.erb.<\/mark> <mark>For example:<\/mark> <mark>&lt;p class=&#8221;notice&#8221;&gt;&lt;%= notice %&gt;&lt;\/p&gt;<\/mark> <mark>&lt;p class=&#8221;alert&#8221;&gt;&lt;%= alert %&gt;&lt;\/p&gt;<\/mark> * Not required for API-only Applications * 4. You can copy Devise views (for customization) to your app by running: rails g devise:views * Not required * ===============================================================================<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u3053\u306e\u624b\u9806\u3067\u306f\u30de\u30cb\u30e5\u30a2\u30eb\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u5f8c\u3067\u901a\u77e5\u3068\u8b66\u544a\u306e\u305f\u3081\u306e\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>Devise\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\u6b21\u306b\u3001\u751f\u6210\u3055\u308c\u305fDevise\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u3067\u3044\u304f\u3064\u304b\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30d0\u30a4\u30b9\uff1a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Devise\u306e\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308bconfig\/initializers\/devise.rb\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3059\u308b\u3068\u304d\u306b\u3001Rails\u306f\u3059\u3079\u3066\u306egem\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ed\u30fc\u30c9\u3057\u3001\u305d\u306e\u5f8c\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u3055\u307e\u3056\u307e\u306a\u90e8\u5206\u306e\u7279\u5b9a\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u306f\u3059\u3079\u3066config\/initializers\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5b58\u5728\u3057\u3001Devise gem\u3082\u305d\u306e\u521d\u671f\u5316\u30d5\u30a1\u30a4\u30eb\u3092\u3053\u3053\u306b\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u7de8\u96c6\u3059\u308b\u305f\u3081\u306bconfig\/initializers\/devise.rb\u3092\u958b\u304f\u3002\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u3001Devise.setup\u30d6\u30ed\u30c3\u30af\u3092\u898b\u3064\u3051\u3066\u3001\u4ee5\u4e0b\u306e\u5f37\u8abf\u3055\u308c\u305f\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\uff08Devise.setup\u30d6\u30ed\u30c3\u30af\u5185\u306b\u4ed6\u306e\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u304c\u3042\u308b\u5834\u5408\u306f\u7121\u8996\u3057\u3066\u69cb\u3044\u307e\u305b\u3093\uff09\u3002<\/p>\n<div>\n<p>\u30c7\u30d0\u30a4\u30b9\u306e.rb\u30d5\u30a1\u30a4\u30eb\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff1a<\/p>\n<p>\u8a2d\u5b9a\/\u521d\u671f\u5316\u5b50\/devise.rb<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>Devise<span class=\"token punctuation\">.<\/span>setup <span class=\"token keyword\">do<\/span> <span class=\"token operator\">|<\/span>config<span class=\"token operator\">|<\/span>\r\n  <span class=\"token comment\"># ...<\/span>\r\n\r\n  <mark>config<span class=\"token punctuation\">.<\/span>navigational_formats <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string-literal\"><span class=\"token string\">'*\/*'<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">:html<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">:turbo_stream<\/span><span class=\"token punctuation\">]<\/span><\/mark>\r\n\r\n  <span class=\"token comment\"># ...<\/span>\r\n<span class=\"token keyword\">end<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u306e\u884c\u306f\u3001\u30bf\u30fc\u30dc\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u5f62\u5f0f\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u30bf\u30fc\u30dc\u30b9\u30c8\u30ea\u30fc\u30e0\u306f\u3001Turbo\u306e\u4e00\u90e8\u3067\u3042\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u305fHTML\u3092\u9001\u4fe1\u3057\u3001JavaScript\u3092\u3042\u307e\u308a\u4f7f\u7528\u305b\u305a\u306b\u30da\u30fc\u30b8\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002Rails 7\u3067Devise 4.8.1\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3053\u308c\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3046\u3057\u306a\u3051\u308c\u3070\u3001undefined method user_url \u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u308b\u3002<\/p>\n<p>\u6b21\u306b\u3001\u4ee5\u524d\u306e\u5370\u5237\u3055\u308c\u305f\u6307\u793a\u66f8\u3067\u5f37\u8abf\u3055\u308c\u3066\u3044\u308b\u901a\u77e5\u3068\u30a2\u30e9\u30fc\u30c8\u306e\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u30a2\u30e9\u30fc\u30c8\u3068\u901a\u77e5\u306e\u30bf\u30b0\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u8868\u793a\u3055\u308c\u308b\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u9593\u9055\u3063\u3066\u3044\u307e\u3059\u300d\u3068\u3044\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5834\u6240\u3067\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u306f\u5e38\u306b\u30ab\u30b9\u30bf\u30e0\u306a\u30a2\u30e9\u30fc\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff08\u305f\u3068\u3048\u3070\u3001React\u3092\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3068\u3057\u3066Axios\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306a\u3069\uff09\u3001\u3057\u304b\u3057\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306fDevise\u306e\u6700\u4f4e\u9650\u306e\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306ehtml.erb\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3057\u3087\u3046\u3002body\u30bf\u30b0\u306e\u76f4\u4e0a\u306b\u300cnotice\u300d\u3068\u300calert\u300d\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30bf\u30b0\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5177\u4f53\u7684\u306b\u306f\u3001&lt;%= yield %&gt;\u306e\u76f4\u524d\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\u300capp\/views\/layouts\/application.html.erb\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u65e5\u672c\u8a9e\u306b\u6539\u5909\u3057\u305f\u5834\u5408 :<\/p>\n<p>\u300c\u30a2\u30d7\u30ea\/views\/layouts\/application.html.erb\u300d<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token operator\">...<\/span>\r\n<span class=\"token operator\">&lt;<\/span>body<span class=\"token operator\">&gt;<\/span>\r\n  <mark><span class=\"token operator\">&lt;<\/span>p <span class=\"token keyword\">class<\/span><span class=\"token operator\">=<\/span><span class=\"token string-literal\"><span class=\"token string\">\"notice\"<\/span><\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">%=<\/span> notice <span class=\"token string-literal\"><span class=\"token string\">%&gt;&lt;\/p&gt;<\/span><\/span> <\/mark>\r\n  <mark><span class=\"token operator\">&lt;<\/span>p <span class=\"token keyword\">class<\/span><span class=\"token operator\">=<\/span><span class=\"token string-literal\"><span class=\"token string\">\"alert\"<\/span><\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">%=<\/span> alert <span class=\"token string-literal\"><span class=\"token string\">%&gt;&lt;\/p&gt;<\/span><\/span> <\/mark>\r\n  <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">%=<\/span> <span class=\"token keyword\">yield<\/span> <span class=\"token string-literal\"><span class=\"token string\">%&gt;\r\n&lt;\/body&gt;<\/span><\/span>\r\n<\/code><\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u30d3\u30e5\u30fc\u304c\u63cf\u753b\u3055\u308c\u308b\u3068\u3001&lt;%= yield %&gt;\u30d6\u30ed\u30c3\u30af\u306f\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u3001p\u30bf\u30b0\u306e\u307f\u304c\u5b58\u5728\u3057\u307e\u3057\u305f\u3002\u3053\u306eyield\u30bf\u30b0\u306f\u305d\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bDevise\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Devise\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d74 \u2014 Devise\u3092\u4f7f\u7528\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>Devise\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u751f\u6210\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5fc5\u8981\u306a\u30e2\u30c7\u30eb\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u3067users\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002\u8ab0\u304b\u304c\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3073\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eusers\u30c6\u30fc\u30d6\u30eb\u306b\u65b0\u3057\u3044\u30ec\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30d3\u30e5\u30fc\u304b\u3089\u3053\u308c\u3089\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30ec\u30b3\u30fc\u30c9\u3092\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u751f\u6210\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>Rails\u306f\u30e2\u30c7\u30eb\u30d3\u30e5\u30fc\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\uff08MVC\uff09\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308b\u305f\u3081\u3001\u5404\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u305d\u308c\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30af\u30e9\u30b9\u304c\u3042\u308a\u3001\u305d\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001User\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066User.first\u3084User.find_by_email(&#8220;sammy@example.com&#8221;)\u306a\u3069\u306e\u64cd\u4f5c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Rails\u3067\u306f\u3001\u901a\u5e38\u306e\u30af\u30e9\u30b9\u3092ApplicationRecord\u304b\u3089\u7d99\u627f\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001Devise\u3092\u4f7f\u7528\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u751f\u6210\u3059\u308b\u3068\u3001\u8a8d\u8a3c\u306b\u4f7f\u7528\u3067\u304d\u308b\u591a\u304f\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>Devise\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u751f\u6210\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token builtin class-name\">exec<\/span> rails g devise user<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>invoke active_record create db\/migrate\/20220908152949_devise_create_users.rb create app\/models\/user.rb invoke test_unit create test\/models\/user_test.rb create test\/fixtures\/users.yml insert app\/models\/user.rb route devise_for :users<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u306b\u3088\u308b\u3068\u3001Devise\u306f\u3044\u304f\u3064\u304b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u3001\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3001\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002\u6700\u521d\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308bdb\/migrate\/20220908152949_devise_create_users.rb\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eusers\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002Rails\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u884c\u3046\u5fc5\u8981\u306e\u3042\u308b\u5909\u66f4\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u5404\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u306f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001Rails\u306f\u3053\u308c\u3089\u306e\u5909\u66f4\u3092\u3069\u306e\u9806\u5e8f\u3067\u884c\u3046\u304b\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30d0\u30a4\u30b9\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\uff08app\/models\/user.rb\uff09\u3068\u305d\u308c\u306b\u5bfe\u3059\u308b\u30c6\u30b9\u30c8\u3082\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u51fa\u529b\u306e\u6700\u5f8c\u306e\u884c\u306b\u306f\u3001\u65e2\u5b58\u306econfig\/routes.rb\u30d5\u30a1\u30a4\u30eb\u306b\u30eb\u30fc\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30c7\u30d0\u30a4\u30b9\u306f\u3001devise_for :users\u30d8\u30eb\u30d1\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\/users\/sign_up\u3084\/users\/sign_out\u306a\u3069\u306e\u30eb\u30fc\u30c8\u3092\u81ea\u52d5\u7684\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u524d\u306b\u3001\u751f\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u6642\u306b\u4f55\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u304b\u3092\u7406\u89e3\u3057\u3001Devise\u304c\u751f\u6210\u3057\u305f\u8a2d\u5b9a\u3092\u628a\u63e1\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u306f\u3058\u3081\u306b\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u79fb\u884c\u30d5\u30a1\u30a4\u30eb\uff08db\/migrate\/20220908152949_devise_create_users.rb\uff09\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n<div>db\/migrate\/20220908152949_devise_create_users.rb\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<br \/>\ndb\/migrate\/20220908152949_devise_create_users.rb<\/div>\n<pre class=\"post-pre\"><code><span class=\"token comment\"># frozen_string_literal: true<\/span>\r\n\r\n<span class=\"token keyword\">class<\/span> <span class=\"token class-name\">DeviseCreateUsers<\/span> <span class=\"token operator\">&lt;<\/span> ActiveRecord<span class=\"token double-colon punctuation\">::<\/span>Migration<span class=\"token punctuation\">[<\/span><span class=\"token number\">7.0<\/span><span class=\"token punctuation\">]<\/span>\r\n  <span class=\"token keyword\">def<\/span> <span class=\"token method-definition\"><span class=\"token function\">change<\/span><\/span>\r\n    create_table <span class=\"token symbol\">:users<\/span> <span class=\"token keyword\">do<\/span> <span class=\"token operator\">|<\/span>t<span class=\"token operator\">|<\/span>\r\n      <span class=\"token comment\">## Database authenticatable<\/span>\r\n      t<span class=\"token punctuation\">.<\/span>string <span class=\"token symbol\">:email<\/span><span class=\"token punctuation\">,<\/span>              <span class=\"token symbol\">null<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">default<\/span><span class=\"token operator\">:<\/span> <span class=\"token string-literal\"><span class=\"token string\">\"\"<\/span><\/span>\r\n      t<span class=\"token punctuation\">.<\/span>string <span class=\"token symbol\">:encrypted_password<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">null<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">default<\/span><span class=\"token operator\">:<\/span> <span class=\"token string-literal\"><span class=\"token string\">\"\"<\/span><\/span>\r\n\r\n      <span class=\"token comment\">## Recoverable<\/span>\r\n      t<span class=\"token punctuation\">.<\/span>string   <span class=\"token symbol\">:reset_password_token<\/span>\r\n      t<span class=\"token punctuation\">.<\/span>datetime <span class=\"token symbol\">:reset_password_sent_at<\/span>\r\n\r\n      <span class=\"token comment\">## Rememberable<\/span>\r\n      t<span class=\"token punctuation\">.<\/span>datetime <span class=\"token symbol\">:remember_created_at<\/span>\r\n\r\n      <span class=\"token comment\">## Trackable<\/span>\r\n      <span class=\"token comment\"># t.integer  :sign_in_count, default: 0, null: false<\/span>\r\n      <span class=\"token comment\"># t.datetime :current_sign_in_at<\/span>\r\n      <span class=\"token comment\"># t.datetime :last_sign_in_at<\/span>\r\n      <span class=\"token comment\"># t.string   :current_sign_in_ip<\/span>\r\n      <span class=\"token comment\"># t.string   :last_sign_in_ip<\/span>\r\n\r\n      <span class=\"token comment\">## Confirmable<\/span>\r\n      <span class=\"token comment\"># t.string   :confirmation_token<\/span>\r\n      <span class=\"token comment\"># t.datetime :confirmed_at<\/span>\r\n      <span class=\"token comment\"># t.datetime :confirmation_sent_at<\/span>\r\n      <span class=\"token comment\"># t.string   :unconfirmed_email # Only if using reconfirmable<\/span>\r\n\r\n<\/code><\/pre>\n<p>\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30bb\u30c3\u30c8\u30c8\u30fc\u30af\u30f3\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3084\u6700\u5f8c\u306e\u30c8\u30fc\u30af\u30f3\u9001\u4fe1\u6642\u9593\u306a\u3069\u3001\u591a\u304f\u306e\u4fbf\u5229\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u3002\u3055\u3089\u306b\u3001\u30e1\u30fc\u30eb\u78ba\u8a8d\u3084\u30ed\u30b0\u30a4\u30f3\u5931\u6557\u5f8c\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30ed\u30c3\u30af\u30a2\u30a6\u30c8\u3001\u30ed\u30b0\u30a4\u30f3\u306e\u8a73\u7d30\u306e\u8ffd\u8de1\u306a\u3069\u306e\u6a5f\u80fd\u306e\u305f\u3081\u306e\u884c\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f55\u3082\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u306e\u3067\u3001\u79fb\u884c\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Devise\u306fUser\u30e2\u30c7\u30eb\u30d5\u30a1\u30a4\u30eb\u3082\u751f\u6210\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u306fapp\/models\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u30a2\u30d7\u30ea\u306eapp\/models\/user.rb\u30e2\u30c7\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u30d6\u30ed\u30b0\/\u30a2\u30d7\u30ea\/\u30e2\u30c7\u30eb\/\u30e6\u30fc\u30b6\u30fc.rb<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">class<\/span> <span class=\"token class-name\">User<\/span> <span class=\"token operator\">&lt;<\/span> ApplicationRecord\r\n<span class=\"token comment\"># Include default devise modules. Others available are:<\/span>\r\n<span class=\"token comment\"># :confirmable, :lockable, :timeoutable, :trackable and :omniauthable<\/span>\r\ndevise <span class=\"token symbol\">:database_authenticatable<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">:registerable<\/span><span class=\"token punctuation\">,<\/span>\r\n       <span class=\"token symbol\">:recoverable<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">:rememberable<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token symbol\">:validatable<\/span>\r\n<span class=\"token keyword\">end<\/span>\r\n<\/code><\/pre>\n<p>Devise\u306b\u3088\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u306e\u52d5\u4f5c\u65b9\u6cd5\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306e\u3044\u304f\u3064\u304b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\uff08database_authenticatable\u3001registerable\u3001recoverable\u3001rememberable\u3001validatable\uff09\u306f\u3059\u3067\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3067\u898b\u305f\u8ffd\u52a0\u306e\u6a5f\u80fd\u306b\u5bfe\u5fdc\u3059\u308b\u3044\u304f\u3064\u304b\u306e\u8ffd\u52a0\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30e2\u30c7\u30eb\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u5fc5\u8981\u306a\u6a5f\u80fd\u306b\u5fdc\u3058\u3066\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u57fa\u672c\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u6a5f\u80fd\u3067\u3059\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>database_authenticatable: Users can authenticate themselves with a login and password field. Their encrypted password will be stored in your database.<\/li>\n<li>registerable: Users can register themselves and can edit or delete their accounts.<\/li>\n<li>recoverable: Users can reset their password and recover their accounts if they forget their credentials.<\/li>\n<li>rememberable: This module remembers a user\u2019s sessions by saving the information in a browser cookie.<\/li>\n<li>validatable: This module provides validations for the user\u2019s email and password fields. (For example, your application asks for the password to be at least six characters, even though you haven\u2019t defined any custom validations in your model.)<\/li>\n<\/ul>\n<p>\u3042\u306a\u305f\u304c\u4f5c\u6210\u3057\u305fUser\u30e2\u30c7\u30eb\u306b\u306f\u3001\u3053\u308c\u3089\u306e\u57fa\u672c\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002Devise\u304c\u63d0\u4f9b\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b8c\u5168\u306a\u30ea\u30b9\u30c8\u306f\u3001Devise\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f55\u3082\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3082\u3046\u3072\u3068\u3064\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306f\u3001config\/routes.rb\u30d5\u30a1\u30a4\u30eb\u304c\u4fee\u6b63\u3055\u308c\u3066\u3001users\u306e\u305f\u3081\u306bdevise_for\u884c\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"post-pre\"><code>Rails<span class=\"token punctuation\">.<\/span>application<span class=\"token punctuation\">.<\/span>routes<span class=\"token punctuation\">.<\/span>draw <span class=\"token keyword\">do<\/span>\r\n  <mark>devise_for <span class=\"token symbol\">:users<\/span><\/mark>\r\n\r\n  root <span class=\"token string-literal\"><span class=\"token string\">\"home#index\"<\/span><\/span>\r\n<span class=\"token keyword\">end<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u308c\u306f\u3001\/users\/sign_in\u3001\/users\/sign_out\u3001\u304a\u3088\u3073\/users\/password\/new\u306a\u3069\u3001\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306b\u95a2\u9023\u3059\u308b\u3059\u3079\u3066\u306e\u5fc5\u8981\u306a\u30eb\u30fc\u30c8\u3092\u5b9a\u7fa9\u3059\u308b\u4fbf\u5229\u306a\u65b9\u6cd5\u3067\u3059\u3002 Devise\u306f\u305d\u308c\u3092\u3059\u3079\u3066\u3042\u306a\u305f\u306e\u305f\u3081\u306b\u51e6\u7406\u3057\u3001\u30eb\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u3082\u304d\u308c\u3044\u306b\u4fdd\u3061\u307e\u3059\u3002 devise_for: users\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u308c\u3089\u3059\u3079\u3066\u306e\u30eb\u30fc\u30c8\u306b\u81ea\u52d5\u7684\u306b\u5909\u63db\u3055\u308c\u308b\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u7406\u89e3\u3057\u305f\u3044\u5834\u5408\u306f\u3001Devise\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u4f55\u3082\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001config\/routes.rb\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30eb\u30fc\u30c8\u3092\u77e5\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token builtin class-name\">exec<\/span> rails routes<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u3059\u3079\u3066\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u3068\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u8a8d\u8a3c\u306e\u5834\u5408\u3001\u3053\u308c\u3089\u306e\u30eb\u30fc\u30c8\u306fDevise\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3055\u308c\u3001\u624b\u52d5\u3067\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u51fa\u529b\u7d50\u679c\u306f\u9577\u304f\u306a\u308a\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306b\u3044\u304f\u3064\u304b\u306e\u30eb\u30fc\u30c8\u306e\u4e00\u90e8\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<div>\n<div class=\"post-table\">\n<table>\n<thead>\n<tr>\n<th>Prefix<\/th>\n<th>Verb<\/th>\n<th>URI Pattern<\/th>\n<th>Controller#Action<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>new_user_session<\/td>\n<td>GET<\/td>\n<td>\/users\/sign_in(.:format)<\/td>\n<td>devise\/sessions#new<\/td>\n<\/tr>\n<tr>\n<td>user_session<\/td>\n<td>POST<\/td>\n<td>\/users\/sign_in(.:format)<\/td>\n<td>devise\/sessions#create<\/td>\n<\/tr>\n<tr>\n<td>destroy_user_session<\/td>\n<td>DELETE<\/td>\n<td>\/users\/sign_out(.:format)<\/td>\n<td>devise\/sessions#destroy<\/td>\n<\/tr>\n<tr>\n<td>new_user_password<\/td>\n<td>GET<\/td>\n<td>\/users\/password\/new(.:format)<\/td>\n<td>devise\/passwords#new<\/td>\n<\/tr>\n<tr>\n<td>edit_user_password<\/td>\n<td>GET<\/td>\n<td>\/users\/password\/edit(.:format)<\/td>\n<td>devise\/passwords#edit<\/td>\n<\/tr>\n<tr>\n<td>user_password<\/td>\n<td>PATCH<\/td>\n<td>\/users\/password(.:format)<\/td>\n<td>devise\/passwords#update<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>PUT<\/td>\n<td>\/users\/password(.:format)<\/td>\n<td>devise\/passwords#update<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>POST<\/td>\n<td>\/users\/password(.:format)<\/td>\n<td>devise\/passwords#create<\/td>\n<\/tr>\n<tr>\n<td>cancel_user_registration<\/td>\n<td>GET<\/td>\n<td>\/users\/cancel(.:format)<\/td>\n<td>devise\/registrations#cancel<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u51fa\u529b\u3055\u308c\u305f\u30eb\u30fc\u30c8\u306f\u3001\u30c7\u30d0\u30a4\u30b9\u3092\u542b\u3081\u3066routes\u30d5\u30a1\u30a4\u30eb\u306bdevise_for :users\u306e\u884c\u3092\u8ffd\u52a0\u3057\u305f\u969b\u306b\u8ffd\u52a0\u3055\u308c\u305f\u30eb\u30fc\u30c8\u3067\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u30b5\u30a4\u30f3\u30a4\u30f3\u3001\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30bb\u30c3\u30c8\u306a\u3069\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u305f\u3081\u306e\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u624b\u9806\u306e\u6700\u521d\u306b\u751f\u6210\u3057\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001Devise\u3067\u751f\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3068\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token builtin class-name\">exec<\/span> rails db:migrate<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u5404\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u306e\u5168\u3066\u306e\u5909\u66f4\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9069\u7528\u3057\u307e\u3059\u3002\u5909\u66f4\u306f\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u9806\u756a\u901a\u308a\u306b\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002Rails\u306f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u9806\u5e8f\u3092\u628a\u63e1\u3059\u308b\u305f\u3081\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>== 20220908152949 DeviseCreateUsers: migrating ================================ &#8212; create_table(:users) -&gt; 0.0040s &#8212; add_index(:users, :email, {:unique=&gt;true}) -&gt; 0.0012s &#8212; add_index(:users, :reset_password_token, {:unique=&gt;true}) -&gt; 0.0011s == 20220908152949 DeviseCreateUsers: migrated (0.0074s) =======================<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u308b\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u3067\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u624b\u9806\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u6642\u70b9\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">bundle <span class=\"token builtin class-name\">exec<\/span> rails server<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u524d\u8ff0\u3057\u305f\u30a4\u30cb\u30b7\u30e3\u30e9\u30a4\u30b6\u30d5\u30a1\u30a4\u30eb\u306f\u3001Rails\u304c\u8d77\u52d5\u3059\u308b\u969b\u306b\u306e\u307f\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3059\u3002Devise\u306e\u65b0\u3057\u3044\u30a4\u30cb\u30b7\u30e3\u30e9\u30a4\u30b6\u30d5\u30a1\u30a4\u30eb\u3092Rails\u304c\u8aad\u307f\u8fbc\u307f\u3001\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u304c\u6a5f\u80fd\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u306b\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u300chttp:\/\/localhost:3000\/users\/sign_up\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u3053\u306b\u306f\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u30d5\u30a9\u30fc\u30e0\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3068\u30b5\u30a4\u30f3\u30a4\u30f3\u306e\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u3001\u8aad\u8005\u304c\u3053\u306eURL\u306b\u7c21\u5358\u306b\u79fb\u52d5\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656468ebdaa94e2bdf7b5130\/128-0.png\" alt=\"The signup page generated by Devise\" \/><\/div>\n<p>\u8a8d\u8a3c\u3092\u8a66\u3059\u305f\u3081\u306b\u3001sammy@example.com\u306e\u3088\u3046\u306a\u30c6\u30b9\u30c8\u7528\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u300c\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b\u30eb\u30fc\u30c8\u30da\u30fc\u30b8\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u30da\u30fc\u30b8\u306b\u306f\u3001&#8217;Hello Silicon Cloud!&#8217;\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u304c\u6210\u529f\u3057\u305f\u3053\u3068\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u300d<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656468ebdaa94e2bdf7b5130\/131-0.png\" alt=\"Screencapture showing the landing page the user is redirected to once they've signed up\" \/><\/div>\n<p>\u3053\u306e\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u6210\u529f\u901a\u77e5\u306f\u3001application.html.erb \u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u305f<\/p>\n<p class=\"notice\">&lt;%= notice %&gt;<\/p>\n<p>\u30bf\u30b0\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u6642\u70b9\u3067\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067Devise\u3092\u4f7f\u7528\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3057\u3001\u30b5\u30f3\u30d7\u30eb\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002Devise\u3092\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30cb\u30fc\u30ba\u306b\u5408\u308f\u305b\u3066\u8a2d\u5b9a\u3057\u3001Devise\u304c\u30eb\u30fc\u30c8\u3001\u30d3\u30e5\u30fc\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u751f\u6210\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u306e\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u4f53\u9a13\u3092\u5bb9\u6613\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u300c\u6b63\u5e38\u306b\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u30d7\u30ed\u30bb\u30b9\u304c\u6a5f\u80fd\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u305f\u306e\u3067\u3001\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u30b9\u30c6\u30c3\u30d72\u3067\u4f5c\u6210\u3057\u305f\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u3053\u306e\u8a8d\u8a3c\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u30da\u30fc\u30b8\u3092\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u30ea\u30f3\u30af\u3055\u305b\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306b\u7279\u5b9a\u306eURL\u306b\u79fb\u52d5\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u884c\u3063\u305f\u3088\u3046\u306b\u3002\u300d<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d75 &#8211; \u8a8d\u8a3c\u3092\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u30ea\u30f3\u30af\u3055\u305b\u308b<\/h2>\n<p>\u3042\u306a\u305f\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3059\u3079\u3066\u306e\u6a5f\u80fd\u304c\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u307e\u3060Devise\u304c\u4f5c\u6210\u3057\u305f\u30da\u30fc\u30b8\u3092\u3042\u306a\u305f\u306e\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u63a5\u7d9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u524d\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u624b\u52d5\u3067\/users\/sign_up\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u307e\u3057\u305f\u3002\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u5fc5\u8981\u306a\u30ea\u30f3\u30af\u3092\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u3059\u3079\u3066\u306e\u30da\u30fc\u30b8\u3092\u30ea\u30f3\u30af\u3055\u305b\u307e\u3059\u3002\u307e\u305f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u306b\u57fa\u3065\u3044\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3078\u306e\u30b5\u30a4\u30f3\u30a4\u30f3\u307e\u305f\u306f\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u306e\u30ea\u30f3\u30af\u3092\u6761\u4ef6\u4ed8\u304d\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f5c\u696d\u306f\u3001Devise\u304b\u3089\u3044\u304f\u3064\u304b\u306e\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u9054\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Devise\u306egem\u306b\u306f\u3001\u81ea\u5206\u3067\u3059\u3079\u3066\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001\u5229\u7528\u3067\u304d\u308b\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u304c\u6570\u591a\u304f\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u306b\u3088\u308a\u3001\u30b3\u30fc\u30c9\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3082\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 \u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u306f\u30e6\u30fc\u30b6\u30fc\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u3059\u308b\u305f\u3081\u306e\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 \u30e6\u30fc\u30b6\u30fc\u304c\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u306f\u30b5\u30a4\u30f3\u30a4\u30f3\u30da\u30fc\u30b8\u306b\u79fb\u52d5\u3059\u308b\u305f\u3081\u306e\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30a8\u30c7\u30a3\u30c3\u30c8\u3059\u308b\u305f\u3081\u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\/views\/home\/index.html.erb \u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305f\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>app\/views\/home\/index.html.erb\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a\u300c\u30a2\u30d7\u30ea\/\u30d3\u30e5\u30fc\/\u30db\u30fc\u30e0\/\u30a4\u30f3\u30c7\u30c3\u30af\u30b9.html.erb\u300d<\/div>\n<pre class=\"post-pre\"><code><mark>&lt;% if user_signed_in? %&gt; <\/mark>\r\n <mark>&lt;div&gt; Welcome &lt;%= current_user.email %&gt; &lt;\/div&gt; <\/mark>\r\n  <mark>&lt;%= button_to \"Sign out\", destroy_user_session_path, method: :delete %&gt; <\/mark>\r\n<mark>&lt;% else %&gt;<\/mark>\r\n  <mark>&lt;%= button_to \"Sign in\", new_user_session_path %&gt; <\/mark>\r\n<mark>&lt;% end %&gt;<\/mark>\r\n&lt;h1&gt;Hello Silicon Cloud!&lt;\/h1&gt;\r\n<\/code><\/pre>\n<p>\u300cuser_signed_in?\u300d\u306fDevise\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306b\u95a2\u9023\u3059\u308b\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u6765\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u771f\u507d\u5024\u306etrue\u307e\u305f\u306ffalse\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u7d50\u679c\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u30a2\u30d7\u30ea\u5185\u306e\u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u306a\u3069\u3067\u3059\u3002\u3053\u306e\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001Devise GitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>current_user\u306f\u3001\u73fe\u5728\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306e\u8a73\u7d30\u60c5\u5831\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306eDevise\u306e\u30d8\u30eb\u30d1\u30fc\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u3042\u306a\u305f\u304csammy@example.com\u3067\u30b5\u30a4\u30f3\u30a4\u30f3\u3059\u308b\u3068\u3001current_user\u30d8\u30eb\u30d1\u30fc\u306fsammy@example.com\u306e\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u3092\u8fd4\u3057\u307e\u3059\u3002current_user.email\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u7d50\u679c\u3068\u3057\u3066sammy@example.com\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Devise\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u306e\u30ed\u30b8\u30c3\u30af\u3092\u30bc\u30ed\u304b\u3089\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u3001\u6642\u9593\u3068\u52b4\u529b\u3092\u7bc0\u7d04\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u7d42\u7684\u306b\u3001\u3053\u306e\u30b3\u30fc\u30c9\u3067\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u30b5\u30a4\u30f3\u30a4\u30f3\u3068\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u306e\u30dc\u30bf\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002user_signed_in? \u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306b\u5fdc\u3058\u3066\u3001\u65b0\u305f\u306b\u8ffd\u52a0\u3055\u308c\u305f\u30dc\u30bf\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30a4\u30f3\u30a4\u30f3\u307e\u305f\u306f\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u3092\u7279\u5b9a\u306e\u30eb\u30fc\u30c8\u306b\u79fb\u52d5\u3055\u305b\u308b\u30dc\u30bf\u30f3\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u3001button_to\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u308c\u3089\u306e\u30eb\u30fc\u30c8\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u3001\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u3082\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002destroy_user_session_path\u306f\/users\/sign_out\u306b\u89e3\u6c7a\u3057\u3001new_user_session_path\u306f\/users\/sign_in\u306b\u89e3\u6c7a\u3057\u307e\u3059\u3002\uff08\u4ee5\u524d\u306e\u624b\u9806\u3067\u8aac\u660e\u3055\u308c\u305f\u3088\u3046\u306b\u3001bundle exec rails routes\u3092\u5b9f\u884c\u3057\u3066\u5b8c\u5168\u306a\u30eb\u30fc\u30c8URL\u30d8\u30eb\u30d1\u30fc\u306e\u30ea\u30b9\u30c8\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\uff09<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067\u30da\u30fc\u30b8\u3092\u66f4\u65b0\u3057\u3066\u5909\u66f4\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3082\u3057\u307e\u3060\u30a2\u30d7\u30ea\u306b\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u30da\u30fc\u30b8\u4e0a\u306e\u300c\u30b5\u30a4\u30f3\u30a4\u30f3\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\/users\/sign_in\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u304b\u3089\u3001\u300c\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u300d\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u65b0\u3057\u3044\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30c6\u30b9\u30c8\u7528\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff08\u4f8b\uff1asammy@example.com\uff09\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001\u518d\u3073\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u30da\u30fc\u30b8\u306b\u623b\u308a\u307e\u3059\u3002\u4eca\u5ea6\u306f\u3001\u73fe\u5728\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u8868\u793a\u3055\u308c\u3001\u4ed8\u968f\u306e\u300c\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u300d\u30dc\u30bf\u30f3\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656468ebdaa94e2bdf7b5130\/149-0.png\" alt=\"The landing page after the user has signed in\" \/><\/div>\n<p>\u300c\u767b\u9332\u304c\u6210\u529f\u3057\u307e\u3057\u305f\u300d\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u3082\u5c4a\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u308c\u306b\u3088\u3063\u3066\u3001\u3042\u306a\u305f\u306fDevise\u30b8\u30a7\u30e0\u3092\u6210\u529f\u88cf\u306b\u7d71\u5408\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Rails\u30a2\u30d7\u30ea\u306b\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306bDevise\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002Devise\u306e\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u304a\u3088\u3073\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u304c\u3067\u304d\u308b\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>Devise\u3068\u8ffd\u52a0\u306e\u30d8\u30eb\u30d1\u30fc\u3084\u30e1\u30bd\u30c3\u30c9\u306e\u7406\u89e3\u3092\u6df1\u3081\u308b\u305f\u3081\u306b\u306f\u3001Devise\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u306eREADME\u30d5\u30a1\u30a4\u30eb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306b\u3088\u3063\u3066\u3001\u300c\u30cf\u30ed\u30fc\u30ef\u30fc\u30eb\u30c9\uff01\u300d\u306e\u6328\u62f6\u3092\u30da\u30fc\u30b8\u4e0a\u3067\u6761\u4ef6\u4ed8\u304d\u3067\u8868\u793a\u3057\u3066\u307f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u4f9d\u5b58\u3057\u3066\u300c\u3053\u3093\u306b\u3061\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u300d\u3068\u8868\u793a\u3059\u308b\u306a\u3069\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30fc\u30c9\u306f\u3001Silicon Cloud\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8457\u8005\u306f\u300cWrite for Donations\u30d7\u30ed\u30b0\u30e9\u30e0\u300d\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u5bc4\u4ed8\u3092\u53d7\u3051\u308b\u56e3\u4f53\u3068\u3057\u3066\u300cGirls Who Code\u300d\u3092\u9078\u3073\u307e\u3057\u305f\u3002 \u30a4\u30f3\u30c8\u30ed\u30c0\u30af\u30b7\u30e7\u30f3 Devise\uff08\u30c7\u30d0\u30a4\u30b9\uff09\u306f\u3001Ruby on Rails\u30a2\u30d7 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,18],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-18"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-20T07:34:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T12:27:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656468ebdaa94e2bdf7b5130\/48-0.png\" \/>\n<meta name=\"author\" content=\"\u5149, \u660e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5149, \u660e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"49\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/\",\"name\":\"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2022-09-20T07:34:23+00:00\",\"dateModified\":\"2025-07-31T12:27:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\"},\"description\":\"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\",\"name\":\"\u5149, \u660e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"caption\":\"\u5149, \u660e\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5 - Blog - Silicon Cloud","description":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\/","og_locale":"ja_JP","og_type":"article","og_title":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5","og_description":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-09-20T07:34:23+00:00","article_modified_time":"2025-07-31T12:27:46+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656468ebdaa94e2bdf7b5130\/48-0.png"}],"author":"\u5149, \u660e","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u5149, \u660e","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"49\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/","name":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2022-09-20T07:34:23+00:00","dateModified":"2025-07-31T12:27:46+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55"},"description":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Rails 7\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Devise\u3092\u4f7f\u7528\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55","name":"\u5149, \u660e","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","caption":"\u5149, \u660e"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/rails-7%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a7devise%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":37410,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions\/37410"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}