{"id":590,"date":"2018-05-20T21:11:46","date_gmt":"2018-05-20T12:11:46","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=590"},"modified":"2018-05-01T01:11:59","modified_gmt":"2018-04-30T16:11:59","slug":"rails%e3%81%8c%e3%81%a9%e3%81%86%e3%81%84%e3%81%86%e3%81%b5%e3%81%86%e3%81%ab%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e3%81%8b%e3%81%a3%e3%81%a6%e3%81%84%e3%81%86","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=590","title":{"rendered":"Rails\u304c\u3069\u3046\u3044\u3046\u3075\u3046\u306b\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u304b\u3063\u3066\u3044\u3046\u8a71\u3002: rails g controller"},"content":{"rendered":"<pre><code>\/\/ config\/routes.rb\nget 'userinfo\/index'\n<\/code><\/pre>\n<p>\u307e\u305a\u3001\u3053\u308c\u304c\u3069\u3046\u3044\u3046\u610f\u5473\u304b\u3068\u3044\u3046\u3068\u3001<code>userinfo\/index<\/code>\u3001\u3082\u3063\u3068\u3044\u3046\u3068\u3001http:\/\/localhost:3000\/userinfo\/index \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u53cd\u5fdc\u3059\u308b\u3088\u3063\u3066\u610f\u5473\u306a\u306e\u3067\u3059\u304c\u3001\u3053\u306eURL\u306b\u8868\u793a\u3055\u308c\u308b\u306e\u306f\u3001\u8272\u3005\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u901a\u3057\u3066\u51fa\u6765\u305f\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>\/\/ app\/controllers\/userinfo_controller.rb\ndef index\n  @var = 'hello.'\nend\n<\/code><\/pre>\n<p>\u4f8b\u3048\u3070\u3001\u305d\u306eURL\u306b\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u524d\u306b\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3092\u9069\u7528\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u307e\u3068\u3081\u3066\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3068\u8a00\u3046\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3053\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u4f55\u3092\u66f8\u304f\u304b\u3068\u8a00\u3046\u3068\u3001\u3044\u308f\u3086\u308bRuby\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3068\u3053\u308d\u3067\u3059\u3002<br \/>\n\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u3068\u3053\u308d\u3067\u3059\u306d\u3002<br \/>\n\u666e\u6bb5\u30ed\u30fc\u30ab\u30eb\u3067\u4f5c\u696d\u3059\u308b\u969b\u306b\u306f\u30011\u3064\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u30c4\u30fc\u30eb\u3092\u4f5c\u308b\u969b\u306b\u3001\u305d\u308c\u306a\u308a\u306b\u30b3\u30fc\u30c9\u3092\u304b\u304f\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3044\u3063\u305fRuby\u30b3\u30fc\u30c9\u3092\u3001\u3053\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u3046\u3057\u3066\u30b3\u30fc\u30c9\u304b\u3089\u6700\u7d42\u7684\u306b\u51fa\u529b\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3001\u6b32\u3057\u304b\u3063\u305f\u30c7\u30fc\u30bf\u3092\u3001\u4f55\u3089\u304b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u3042\u3068\u3067\u8aac\u660e\u3059\u308b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u2026\u3053\u3053\u3067\u306f\u30e2\u30c7\u30eb\u3068\u3044\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u30e2\u30c7\u30eb\u306e\u64cd\u4f5c\u3092\u3059\u308b\u306e\u3082\u3053\u3053\u3067\u3084\u308a\u307e\u3059\u3002\u3068\u3044\u3046\u304b\u3084\u308b\u3079\u304d\u3001\u3063\u3066\u3044\u3046\u3060\u3051\u3067\u3059\u3002\u305d\u3063\u3061\u306e\u307b\u3046\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u30fb\u8aad\u307f\u3084\u3059\u3044\u304b\u3089\u3001\u3089\u3057\u3044\u3067\u3059\u3002<\/p>\n<pre><code>\/\/ app\/views\/userinfo\/index.html.erb\n&lt;h1&gt;Userinfo#index&lt;\/h1&gt;\n&lt;p&gt;Find me in app\/views\/userinfo\/index.html.erb&lt;\/p&gt;\n&lt;%= @var %&gt;\n<\/code><\/pre>\n<p>\u305d\u3046\u3057\u3066\u3001\u6700\u5f8c\u306b\u3001URL\u306f\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u901a\u904e\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306fERB\u30d5\u30a1\u30a4\u30eb\u3068\u3044\u3046\u3001\u7279\u6b8a\u306aHTML\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u307b\u307c\u305d\u306e\u307e\u307e\u3001\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u3001\u3064\u307e\u308a\u30011\u756a\u6700\u521d\u306b\u51fa\u3066\u304d\u305f<code>userinfo\/index<\/code>\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u3055\u3063\u304d\u30a2\u30af\u30b7\u30e7\u30f3\u3067\u3055\u308a\u6c17\u306a\u304f\u5b9a\u7fa9\u3057\u3066\u3044\u305f\u3001<code>@var<\/code>\u3092\u3001HTML\u306e\u4e2d\u306b\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u3053\u3053\u307e\u3067\u306e\u4f5c\u696d\u306f\u624b\u52d5\u3067\u3084\u308b\u306e\u304b\u3001\u3068\u3044\u3046\u3068\u3001\u3053\u3053\u304cRails\u306e\u4f7f\u3044\u6240\u3067\u3001<\/p>\n<p><code>rails g controller USERINFO index<\/code><\/p>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c91\u3064\u3067\u3001\u30d5\u30a9\u30eb\u30c0\u30fb\u30d5\u30a1\u30a4\u30eb\u30fb\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u306e\u4f8b\u3067\u3001\u9055\u3046\u3068\u3053\u308d\u306f\u3001\u50d5\u304c\u8ffd\u8a18\u3059\u308b\u5f62\u3067\u66f8\u304d\u52a0\u3048\u305f\u3001<code>@var = 'hello.'<\/code>\u306e\u307f\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ config\/routes.rb get &#8216;userinfo\/index&#8217; \u307e\u305a\u3001\u3053\u308c\u304c\u3069\u3046\u3044\u3046\u610f\u5473\u304b\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-9w","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/590"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=590"}],"version-history":[{"count":1,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/590\/revisions"}],"predecessor-version":[{"id":591,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/590\/revisions\/591"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}