{"id":4334,"date":"2018-06-18T10:08:52","date_gmt":"2018-06-18T01:08:52","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=4334"},"modified":"2023-05-27T23:03:18","modified_gmt":"2023-05-27T14:03:18","slug":"%e3%80%90ruby-on-rails%e3%80%91%e3%80%8c%e3%82%b3%e3%83%b3%e3%83%88%e3%83%ad%e3%83%bc%e3%83%a9%e3%83%bc%e3%80%8d%e3%81%ae%e5%9f%ba%e6%9c%ac","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=4334","title":{"rendered":"\u3010Ruby on Rails\u3011\u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u300d\u306e\u57fa\u672c\u3001\u5b9f\u88c5\u65b9\u6cd5\u3001\u3088\u308a\u826f\u3044\u8a2d\u8a08\u65b9\u6cd5"},"content":{"rendered":"<h2>\u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u300d\u3068\u306f\uff1f<\/h2>\n<p>\u30e6\u30fc\u30b6\u30fc\u304c\u3001URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u969b\u306b\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u767a\u884c\u3055\u308c\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001\u30e2\u30c7\u30eb\u3084\u30d3\u30e5\u30fc\u3078\u3068\u6e21\u3059\u5f79\u5272<\/strong><\/span>\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h2>\u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u300d\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\uff1f<\/h2>\n<p>\u81ea\u52d5\u3067\u751f\u6210\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9(\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf)\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30de\u30f3\u30c9<\/h3>\n<pre class=\"lang:default decode:true\">rails g controller [\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d] [\u30a2\u30af\u30b7\u30e7\u30f3\u540d]<\/pre>\n<h3>\u5b9f\u884c\u4f8b<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4341\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/test\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc.png\" alt=\"\" width=\"423\" height=\"258\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/test\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc.png 423w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/test\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc-300x183.png 300w\" sizes=\"(max-width: 423px) 100vw, 423px\" \/><\/p>\n<p>\u4f8b\u3048\u3070\u3001test\u3068\u3044\u3046\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u3063\u305f\u5834\u5408\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306a\u5b9f\u884c\u7d50\u679c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u305e\u308c\u3001\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u5f8c\u306f\u4e0b\u8a18\u306e\u30d5\u30a9\u30eb\u30c0\u3084\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h4>\n<p>app\/controllers\/(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)_controller.rb<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30af\u30e9\u30b9(ApplicationController\u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u306e\u30af\u30e9\u30b9)\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">class TestController &lt; ApplicationController\r\nend<\/pre>\n<p>\u5b9f\u969b\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u3044\u304f\u306e\u306f\u3053\u306e\u30d5\u30a1\u30a4\u30eb<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>\u30d3\u30e5\u30fc\u30d5\u30a9\u30eb\u30c0<\/h4>\n<p>app\/views\/(\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d)\u306b\u30d5\u30a9\u30eb\u30c0\u304c\u51fa\u6765\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4e2d\u306b\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3059\u308b\u30d3\u30e5\u30fc\u3092\u914d\u7f6e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9<\/h4>\n<p>\u5b9f\u88c5\u3057\u305f\u30bd\u30fc\u30b9\u304c\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u3066\u3044\u308b\u304b\u3001\u78ba\u8a8d\u306e\u81ea\u52d5\u5316\u3092\u884c\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>test\/controllers\/(\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d)_controller_test.rb<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4342\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9.png\" alt=\"\" width=\"378\" height=\"220\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9.png 378w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9-300x175.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9-177x104.png 177w\" sizes=\"(max-width: 378px) 100vw, 378px\" \/><\/p>\n<h4>\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9<\/h4>\n<p>\u30d3\u30e5\u30fc\u3084\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304b\u3089\u547c\u3073\u51fa\u3059\u5171\u901a\u51e6\u7406\u3092\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>app\/helpers\/(\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d)_helper.rb\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4343\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9.png\" alt=\"\" width=\"396\" height=\"216\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9.png 396w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9-300x164.png 300w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/><\/p>\n<h4>\u30a2\u30bb\u30c3\u30c8<\/h4>\n<p>Web\u95a2\u9023\u306e\u30d5\u30a1\u30a4\u30eb(SCSS,CoffeeScript)\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p><strong>CoffeeScript<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>JavaScript\u306e\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e<\/strong><\/span>\u3067\u3001JavaScript\u3068\u8a00\u3046\u3088\u308a\u306fRuby\u306b\u8fd1\u3044\u5f62\u3067\u8a18\u8ff0\u3067\u304d\u308b\u306e\u304c\u7279\u5fb4\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u305f\u969b\u306b\u3001\u4e0b\u8a18\u306e\u5834\u6240\u306b\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>app\/assets\/javascripts\/(\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d).coffee<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4346\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/cofeescript.png\" alt=\"\" width=\"369\" height=\"219\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/cofeescript.png 369w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/cofeescript-300x178.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/cofeescript-177x104.png 177w\" sizes=\"(max-width: 369px) 100vw, 369px\" \/><\/p>\n<p><strong>SCSS<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>CSS\u3092\u3088\u308a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u7684\u306b\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u3092\u8a18\u8ff0\u3059\u308b\u305f\u3081\u306e\u8a00\u8a9e<\/strong><\/span>\u3067CSS\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>app\/assets\/stylesheets\/(\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d).scss\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4347\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/SCSS.png\" alt=\"\" width=\"371\" height=\"175\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/SCSS.png 371w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/SCSS-300x142.png 300w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><\/p>\n<h2>Ruby on Rails\u3067\u3001Hello World<\/h2>\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u969b\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true\">class TestController &lt; ApplicationController\r\n    def index\r\n        render plain: 'Hello world!'\r\n    end\r\nend<\/pre>\n<h3>index\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u4e00\u3064<\/strong><\/span>\u3067\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u300cindex\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u8a18\u8ff0\u3057\u3066\u51e6\u7406\u5185\u5bb9\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<h3>render\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>Rails\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u5099\u308f\u3063\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3078\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u60c5\u5831\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<h4>\u300cplain:\u300d<\/h4>\n<p>\u76f4\u5f8c\u306b\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u8fd4\u3059\u6307\u5b9a\u3067\u3059\u3002<\/p>\n<h2>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u306e\u8a2d\u5b9a<\/h2>\n<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u7279\u5b9a\u306eURL\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u3001\u3069\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u632f\u308b\u304b\u3092\u5b9a\u7fa9\u3059\u308b\u4ed5\u7d44\u307f<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>Rails\u3067\u306f\u3001config\/routes.rb\u30d5\u30a1\u30a4\u30eb\u306b\u3066\u8a18\u8ff0\u3092\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">Rails.application.routes.draw do\r\n  # For details on the DSL available within this file, see http:\/\/guides.rubyonrails.org\/routing.html\r\n  get '\/test', to: 'test#index'\r\nend<\/pre>\n<p>\u4e0a\u8a18\u306e<span style=\"color: #ff0000;\"><strong>\u300cget '\/test(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)', to: 'test#index'\u300d<\/strong><\/span>\u306e\u90e8\u5206\u304c\u4eca\u56de\u8ffd\u52a0\u3057\u305f\u7b87\u6240\u3067\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u9805\u76ee<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>get<\/td>\n<td>\u300c\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u300d\u3067\u3059\u3002\u4eca\u56de\u306fget\u3067\u3059\u304c\u3001\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u9001\u4fe1\u306e\u5834\u5408\u306b\u306fpost\u3092\u4f7f\u3046\u6a5f\u4f1a\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/test<\/td>\n<td>\u300cURL\u30d1\u30bf\u30fc\u30f3\u300d\u3067\u3059\u3002\u300c\u30ea\u30af\u30a8\u30b9\u30c8URL\u300d\u3067\u3001\u5b9f\u969b\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u5165\u529b\u3059\u308bURL\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>to: 'test#index'<\/td>\n<td>\u30ea\u30af\u30a8\u30b9\u30c8\u3055\u308c\u305f\u969b\u306b\u3001\u5bfe\u5fdc\u3059\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3068\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u540d#\u30a2\u30af\u30b7\u30e7\u30f3\u540d\uff09\u3001\u306a\u304a\u3001\u3053\u308c\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u305d\u306e\u5834\u5408\u306f\u76f4\u63a5\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306b\u98db\u3076\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u305f\u3060\u3001\u3053\u306e\u3088\u3046\u306a\u5b9a\u7fa9\u306f<span style=\"color: #ff0000;\"><strong>Rails\u304c\u7406\u60f3\u3068\u3057\u3066\u3044\u308bRestful\u306e\u601d\u60f3\u306b\u306f\u6cbf\u3063\u3066\u3044\u306a\u3044<\/strong><\/span>\u3067\u3059\u3002\u5b9f\u969b\u306e\u958b\u767a\u3067\u306fRestful\u306a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u306a\u308b\u3088\u3046\u4fee\u6b63\u3057\u305f\u65b9\u304c\u826f\u3044\u3067\u3059\u3002Restful API\u306b\u95a2\u3057\u3066\u306f\u4e0b\u8a18\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"nTmdr5SXar\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=5872\">\u3010Web\u958b\u767a\u3011\u300cREST-API(RESTful)\u300d\u3068\u306f\uff1f<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=5872&#038;embed=true#?secret=nTmdr5SXar\" data-secret=\"nTmdr5SXar\" width=\"500\" height=\"282\" title=\"&#8220;\u3010Web\u958b\u767a\u3011\u300cREST-API(RESTful)\u300d\u3068\u306f\uff1f&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h3>\u8a2d\u5b9a\u3057\u305f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\uff1f<\/h3>\n<p>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">rails routes<\/pre>\n<p>\u5bfe\u5fdc\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4443\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_route.png\" alt=\"\" width=\"1269\" height=\"156\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_route.png 1269w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_route-300x37.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_route-768x94.png 768w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_route-1024x126.png 1024w\" sizes=\"(max-width: 1269px) 100vw, 1269px\" \/><\/p>\n<h2>URL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002<\/h2>\n<p>\u300chttp:\/\/(\u8a72\u5f53\u30b5\u30fc\u30d0\u30fc\u306e\uff29\uff30\u30a2\u30c9\u30ec\u30b9):3000\/test(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30b5\u30a4\u30c8\u304c\u8868\u793a\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4440\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_helloworld.png\" alt=\"\" width=\"341\" height=\"102\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_helloworld.png 341w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_helloworld-300x90.png 300w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304b\u3089\u300c\u30d3\u30e5\u30fc\u300d\u3092\u547c\u3073\u51fa\u3059\u3002<\/h2>\n<p>Rails\u306f\u3001MVC\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306a\u306e\u3067\u3001\u3084\u306f\u308a\u30d3\u30e5\u30fc\u306f\u5225\u9014\u7528\u610f\u3059\u3079\u304d\u3067\u3059\u3002<\/p>\n<p>\u30d3\u30e5\u30fc\u3092\u547c\u3073\u51fa\u3059\u306b\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">class TestController &lt; ApplicationController\r\n    def index\r\n        render template: 'test\/index'\r\n    end\r\nend<\/pre>\n<p>\u6b21\u306b\u3001\u300capp\/views\/(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)\u300d\u306e\u4e0b\u306b\u30d3\u30e5\u30fc\u3067\u3042\u308b\uff28\uff34\uff2d\uff2c\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<h3><strong>app\/views\/test\/index.html.erb<\/strong><\/h3>\n<pre class=\"lang:default decode:true\">Hello World!<\/pre>\n<p>HTML\u306e\u4e2d\u306b\u3001\u51fa\u529b\u3057\u305f\u3044\u6587\u5b57\u5217\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001<span style=\"color: #ff0000;\"><strong>ERB(Embedded Ruby\uff1aHTML\u306bRuby\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u3093\u3060\u3068\u3044\u3046\u610f\u5473)<\/strong><\/span>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u3067\u3001\u62e1\u5f35\u5b50\u3068\u3057\u3066<span style=\"color: #ff0000;\"><strong>\u300chtml.erb\u300d<\/strong><\/span>\u3068\u3044\u3046\u3082\u306e\u3092\u3064\u3051\u307e\u3059\u3002<\/p>\n<p>Java\u3067\u8a00\u3048\u3070\u3001<span style=\"color: #ff0000;\"><strong>\u300cJSP\u300d<\/strong><\/span>\u306b\u76f8\u5f53\u3059\u308b\u62e1\u5f35\u5b50\u3068\u6349\u3048\u308c\u3070\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3>URL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002<\/h3>\n<p>\u300chttp:\/\/(\u8a72\u5f53\u30b5\u30fc\u30d0\u30fc\u306e\uff29\uff30\u30a2\u30c9\u30ec\u30b9):3000\/test(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30b5\u30a4\u30c8\u304c\u8868\u793a\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4446\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails\u30d3\u30e5\u30fc_\u7d50\u679c\u8868\u793a.png\" alt=\"\" width=\"342\" height=\"99\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails\u30d3\u30e5\u30fc_\u7d50\u679c\u8868\u793a.png 342w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails\u30d3\u30e5\u30fc_\u7d50\u679c\u8868\u793a-300x87.png 300w\" sizes=\"(max-width: 342px) 100vw, 342px\" \/><\/p>\n<h2>\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306e\u3055\u305b\u65b9\u306e\u7a2e\u985e<\/h2>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306e\u3055\u305b\u65b9\u306f\u4e0b\u8a18\u306e\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>redirect_to\u3092\u4f7f\u3046<\/li>\n<li>render\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046<\/li>\n<li>\u4f55\u3082\u6307\u5b9a\u3057\u306a\u3044\u3002<\/li>\n<\/ul>\n<h3>redirect_to\u3001render\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3002<\/h3>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306ecreate\u30a2\u30af\u30b7\u30e7\u30f3\u3068\u30d3\u30e5\u30fc(new.html.erb)\u3068\u3044\u3046\u3088\u3046\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3068<span style=\"color: #ff0000;\"><strong>\u30d3\u30e5\u30fc\u306e\u5bfe\u5fdc\u95a2\u4fc2\u304c\u306a\u3044\u5834\u5408\u306frender\u304bredirect_to\u30e1\u30bd\u30c3\u30c9\u3067\u9077\u79fb\u5148\u306eURL\u3092\u6307\u5b9a\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/strong><\/span>\u4f7f\u3044\u5206\u3051\u306b\u95a2\u3057\u3066\u306f\u5f8c\u8ff0\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<h3>\u4f55\u3082\u6307\u5b9a\u3057\u306a\u3044<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u4f55\u3082\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u7cfb\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u4f55\u3082\u5024\u3092\u8fd4\u3055\u305a\u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3067\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d3\u30e5\u30fc\u306b\u5bfe\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd<\/strong><\/span>\u3067\u3059\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570(@\u4ed8\u304d\u306e\u5909\u6570\u540d)\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u5185\u3067\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u547c\u3070\u308c\u305f\u30d3\u30e5\u30fc\u5074\u3067\u3082\u4f7f\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u4f8b\u3048\u3070new\u304b\u3089create\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u547c\u3093\u3060\u3068\u304d\u3068\u304b\u3067\u3042\u308c\u3070\u5bfe\u5fdc\u3059\u308b\u30d3\u30e5\u30fc(new.html.erb)\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u306e\u3067\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306frender\u3092\u4f7f\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3068\u30ec\u30f3\u30c0\u30fc\u306e\u4f7f\u3044\u5206\u3051<\/h3>\n<p>Rails\u3067\u306f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306f\u300credirect_to\u30e1\u30bd\u30c3\u30c9\u300d\u3067\u884c\u3044\u30ec\u30f3\u30c0\u30fc\u306f\u300crender\u30e1\u30bd\u30c3\u30c9\u300d\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<h4>\u30ec\u30f3\u30c0\u30fc<\/h4>\n<h5>\u7279\u5fb4<\/h5>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u4f5c\u6210\u3057\u305f\u300c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u300d\u306f\u305d\u306e\u307e\u307eView\u306b\u6e21\u3055\u308c\u308b\u3002<\/p>\n<h5>\u7528\u9014<\/h5>\n<p>\u8868\u793a\u51e6\u7406\u3084\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304b\u305f\u3060\u8868\u793a\u3055\u305b\u308b\u3068\u8a00\u3063\u305f\u51e6\u7406\u306e\u5834\u5408\u306b\u4f7f\u3046\u3002<\/p>\n<h4>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h4>\n<h5>\u7279\u5fb4<\/h5>\n<p>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u884c\u3063\u305f\u5834\u5408\u518d\u5ea6\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u8981\u3059\u308b\u3002<\/p>\n<h5>\u7528\u9014<\/h5>\n<p>\u767b\u9332\u3001\u66f4\u65b0\u3001\u524a\u9664\u7b49\u306e\u4f55\u3089\u304b\u306e\u51e6\u7406\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u306e\u51e6\u7406\u304c\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3053\u3061\u3089\u3092\u4f7f\u3046\u3002<\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306b\u8a18\u8ff0\u3059\u308b\u51e6\u7406<\/h2>\n<ul>\n<li>\u30a2\u30af\u30b7\u30e7\u30f3\u7fa4<\/li>\n<li>\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u4e8b\u524d\u4e8b\u5f8c\u306e\u30d5\u30a3\u30eb\u30bf\u51e6\u7406<\/li>\n<li>params\u306b\u95a2\u3059\u308b\u51e6\u7406<\/li>\n<li>\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u95a2\u3059\u308b\u51e6\u7406<\/li>\n<li>URL\u751f\u6210\u306b\u95a2\u3059\u308b\u51e6\u7406<\/li>\n<li>\u30e2\u30c7\u30eb\u3092\u5229\u7528\u3059\u308b\u5c11\u91cf\u306e\u30b3\u30fc\u30c9<\/li>\n<li>\u30e1\u30fc\u30eb\u3084\u30e2\u30c7\u30eb\u4ee5\u5916\u306e\u30ed\u30b8\u30c3\u30af<\/li>\n<li>\u30d3\u30e5\u30fc\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3084\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u52d5\u7684\u751f\u6210\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u7ba1\u7406<\/li>\n<\/ul>\n<h2>\u30e2\u30c7\u30eb\u306b\u8a18\u8ff0\u3059\u308b\u3079\u304d\u51e6\u7406\u306f\u30e2\u30c7\u30eb\u306b\u5bc4\u305b\u308b\u3053\u3068<\/h2>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f<span style=\"color: #ff0000;\"><strong>\u30e2\u30c7\u30eb\u3068\u30d3\u30e5\u30fc\u306e\u4e2d\u9593\u7684\u5b58\u5728\u306a\u306e\u3067\u80a5\u5927\u5316\u3057\u3084\u3059\u3044<\/strong><\/span>\u3067\u3059\u3002\u3067\u304d\u308b\u3060\u3051\u30e2\u30c7\u30eb\u5074\u306b\u51e6\u7406\u3092\u5bc4\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u591a\u5c11\u5909\u308f\u3063\u305f\u5f62\u306eparams\u304b\u3089\u306e\u4ee3\u5165\u30b3\u30fc\u30c9<\/h3>\n<p>\u30e2\u30c7\u30eb\u5074\u3067params\u306e\u5f62\u3092\u6a19\u6e96\u5316\u3057\u305f\u308a\u3001\u30e2\u30c7\u30eb\u5074\u306b\u9069\u5207\u306a\u53d7\u3051\u53e3\uff08\u4ee3\u5165\u53e3\uff09\u3092\u4f5c\u3063\u305f\u4e0a\u3067\u4e00\u62ec\u4ee3\u5165\u3067\u6e08\u307e\u305b\u308b\u3002\uff08\u4f8b\u3048\u3070\u3001\u90f5\u4fbf\u756a\u53f7\u304c\u753b\u9762\u3067\u306f\u3070\u3089\u3051\u3066\u3044\u308b\u304c\u30e2\u30c7\u30eb\u3067\u306f\u4e00\u3064\u306e\u30ab\u30e9\u30e0\u3067\u7247\u4ed8\u3051\u308b\u5834\u5408\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u5074\u3067\u51e6\u7406\u305b\u305a\u306b\u3001\u30e2\u30c7\u30eb\u5074\u3067\u7d50\u5408\u51e6\u7406\u3092\u884c\u3046\u3002\uff09<\/p>\n<h3>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u90e8\u72b6\u614b\u3092\u5909\u66f4\u3059\u308b\u30b3\u30fc\u30c9\uff08\u4ee3\u5165\u3001\u51e6\u7406\u547c\u3073\u51fa\u3057\uff09<\/h3>\n<p>before_save\u7b49\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u5229\u7528\u3057\u305f\u308a\u3001\u7d71\u5408\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002\u4f8b\u3048\u3070\u3001\u4eba\u306e\u5e74\u9f62\u306b\u3088\u3063\u3066\u4eba\u306e\u5065\u5eb7\u72b6\u614b\u3092\u5909\u66f4\u3059\u308b\u3088\u3046\u306a\u51e6\u7406\u3067\u3042\u308c\u3070\u30e2\u30c7\u30eb\u5074\u306b\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u8a18\u8ff0\u3057\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u306f\u305d\u308c\u3092\u547c\u3073\u51fa\u3059\u3060\u3051\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30e2\u30c7\u30eb\u306e\u691c\u7d22\u6761\u4ef6\u3092\u4f5c\u308a\u8fbc\u3080\u30b3\u30fc\u30c9<\/h3>\n<p>scope\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30e2\u30c7\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u63c3\u3048\u308b\u305f\u3081\u306e\u6e96\u5099\u51e6\u7406<\/h3>\n<p>\u30e2\u30c7\u30eb\u64cd\u4f5c\u306b\u5408\u308f\u305b\u3066\u62c5\u5f53\u3055\u305b\u308b\u304b\u5fc5\u8981\u60c5\u5831\u3092\u8868\u3059\u30e2\u30c7\u30eb\u3092\u65b0\u8a2d\u3057\u3066\u63c3\u3048\u308b\u51e6\u7406\u3092\u62c5\u5f53\u3055\u305b\u307e\u3059\u3002<\/p>\n<h3>\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u30e2\u30c7\u30eb\u306b\u5bc4\u305b\u308b<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30c7\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u5074\u306b\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u304c\u3042\u308b\u3068\u30d3\u30e5\u30fc\u306e\u6570\u3060\u3051\u30c6\u30b9\u30c8\u3092\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u304f\u306a\u308b\u3002<\/li>\n<\/ul>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f\u3042\u304f\u307e\u3067\u30ec\u30f3\u30c0\u30fc\u3084\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u7b49\u306e\u8868\u793a\u7528\u306e\u51e6\u7406\u3060\u3051\u8a18\u8ff0\u3057\u3001\u8a08\u7b97\u51e6\u7406\u3084\u5224\u5b9a\u51e6\u7406\u7b49\u306e\u8868\u793a\u3068\u306f\u95a2\u4fc2\u306a\u3044\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306e\u51e6\u7406\u306f\u8a18\u8ff0\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u30a2\u30af\u30b7\u30e7\u30f3\u3054\u3068\u306b\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u540c\u3058\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u4e2d\u3067\u8907\u6570\u306e\u30a2\u30af\u30b7\u30e7\u30f3(index\u3084create\uff09\u304c\u3042\u3063\u305f\u5834\u5408\u306b<span style=\"color: #ff0000;\"><strong>\u305d\u308c\u305e\u308c\u3067\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092new\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true\">class XXXCntroller\r\n  #\u4e00\u89a7\u8868\u793a\u30a2\u30af\u30b7\u30e7\u30f3\r\n  def index\r\n    @user = User.new\r\n  end\r\n\r\n  #\u767b\u9332\u30a2\u30af\u30b7\u30e7\u30f3\r\n  def create\r\n    user = User.new(user_params)\r\n\u3000\u3000\u2025\r\n  end\r\nend<\/pre>\n<h3>\u305d\u308c\u305e\u308c\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3067new\u3059\u308b\u7406\u7531<\/h3>\n<p>Web\u30a2\u30d7\u30ea\u3067\u306f\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u5ea6\u306b\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u3066\u524d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u51e6\u7406\u3055\u308c\u305f\u5185\u5bb9\u306f\u6b21\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u305d\u306e\u307e\u307e\u5229\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002Rails\u306ePuma\u306f\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u3067\u51e6\u7406\u3059\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u683c\u7d0d\u3057\u3066\u3044\u308b\u306e\u3067\u4ed6\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u3082\u4e00\u5fdc\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u306a\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u305f\u3081\u306b\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6e21\u3057\u305f\u308a\u3082\u3057\u304f\u306f\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u3084DB\u306b\u4fdd\u5b58\u3059\u308b\u3068\u8a00\u3063\u305f\u624b\u9593\u304c\u767a\u751f\u3059\u308b\u306e\u3067\u901a\u5e38\u306f\u3053\u306e\u3088\u3046\u306b<span style=\"color: #ff0000;\"><strong>\u5225\u3005\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3067\u5225\u3005\u306e\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u306e\u304c\u4e00\u822c\u7684<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h2>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6642\u306f\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u767b\u9332\u753b\u9762\u3068\u304b\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u65bd\u3059\u308b\u524d\u306f\u5fc5\u305a\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true\">@task = \u30e2\u30c7\u30eb\u540d.new(\u30e2\u30c7\u30eb\u540d_params)<\/pre>\n<h3>\u7406\u7531<\/h3>\n<ul>\n<li>\u524d\u56de\u64cd\u4f5c\u3057\u305f\u307e\u307e\u306e\u5024\u3092\u305d\u306e\u307e\u307e\u30d5\u30a9\u30fc\u30e0\u306b\u5f15\u304d\u7d99\u3044\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u3059\u308b\u305f\u3081<\/li>\n<li>\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30a8\u30e9\u30fc\u5185\u5bb9\u3092\u753b\u9762\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3002<\/li>\n<\/ul>\n<p>\u3082\u3057\u3001\u3053\u308c\u304c\u3067\u304d\u306a\u3044\u3068<span style=\"color: #ff0000;\"><strong>\u30e6\u30fc\u30b6\u30fc\u304c\u518d\u5ea6\u4e00\u304b\u3089\u5165\u529b\u3057\u76f4\u3057\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u308a\u4f55\u3092\u3069\u3046\u6cbb\u3057\u3066\u826f\u3044\u304b\u308f\u304b\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u975e\u5e38\u306b\u30a4\u30e9\u30a4\u30e9\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3057\u307e\u3046<\/strong><\/span>\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>\u7ba1\u7406\u7cfb\u6a5f\u80fd\u3092\u4f5c\u308b\u5834\u5408<\/h2>\n<p>\u7ba1\u7406\u8005\u7cfb\u306e\u6a5f\u80fd\u3092\u4f5c\u308b\u5834\u5408\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300cAdmin::BaseController\u300d<\/strong><\/span>\u3068\u3044\u3046\u5171\u901a\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u305f\u898f\u5b9a\u30af\u30e9\u30b9\u3092\u4f5c\u5229\u5404\u7ba1\u7406\u7cfb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u7d99\u627f\u3055\u305b\u308b\u3088\u3046\u306b\u4f5c\u308b\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u3002<\/p>\n<h2>\u767b\u9332\u3001\u66f4\u65b0\u6a5f\u80fd\u3092\u4f5c\u308b\u5834\u5408<\/h2>\n<ul>\n<li>strong parameter\u3092\u4f7f\u3063\u3066\u7279\u5b9a\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u307f\u3057\u304bPOST\u3092\u8a31\u53ef\u3057\u306a\u3044\u3088\u3046\u306a\u4f5c\u308a\u306b\u3057\u307e\u3059\u3002\uff08\u8aa4\u3063\u3066\u610f\u56f3\u3057\u306a\u3044\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u767b\u9332\u3055\u308c\u305f\u308a\u3057\u306a\u3044\u3088\u3046\u306b\uff09<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u300d\u3068\u306f\uff1f \u30e6\u30fc\u30b6\u30fc\u304c\u3001URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u969b\u306b\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u767a\u884c\u3055\u308c\u307e\u3059\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001\u30e2\u30c7\u30eb\u3084\u30d3\u30e5\u30fc\u3078\u3068\u6e21\u3059\u5f79\u5272\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u3053\u3068\u3067\u3059\u3002 \u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u300d\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\uff1f \u81ea\u52d5 [&hellip;]","protected":false},"author":1,"featured_media":4265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4334"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4334"}],"version-history":[{"count":18,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4334\/revisions"}],"predecessor-version":[{"id":20555,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4334\/revisions\/20555"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/4265"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4334"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}