{"id":578,"date":"2017-10-25T23:00:34","date_gmt":"2017-10-25T14:00:34","guid":{"rendered":"http:\/\/lizefieldwp.azurewebsites.net\/?p=578"},"modified":"2017-10-04T16:47:45","modified_gmt":"2017-10-04T07:47:45","slug":"association%e5%85%88%e3%82%82%e3%82%b7%e3%83%aa%e3%82%a2%e3%83%a9%e3%82%a4%e3%82%ba%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/2017\/10\/25\/association%e5%85%88%e3%82%82%e3%82%b7%e3%83%aa%e3%82%a2%e3%83%a9%e3%82%a4%e3%82%ba%e3%81%99%e3%82%8b\/","title":{"rendered":"association\u5148\u3082\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3059\u308b"},"content":{"rendered":"<p>Rails\u3067model\u3092\u5229\u7528\u3059\u308b\u969b\u306bassociation\u5148\u3082\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3057\u305f\u3044\u5834\u5408\u306e\u65b9\u6cd5\u30e1\u30e2<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nclass CodeMaster &lt; ApplicationRecord\r\n  has_many :code_values\r\n\r\n  def as_json options = {}\r\n    super include: :code_values\r\n  end\r\nend\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nclass ApplicationController &lt; ActionController::Base\r\n  protect_from_forgery with: :exception\r\n  before_action :get_menus\r\n\r\n  def get_codes\r\n    @codes = CodeMaster.all\r\n  end\r\nend\r\n<\/pre>\n<p>\u300cas_json\u300d\u3092\u4f7f\u3063\u3066\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u5316\u3059\u308b\u969b\u306bassociation\u5148\u3082\u542b\u3081\u308b<br \/>\n\u305f\u3060\u3001\u89aa\u30ec\u30b3\u30fc\u30c9\u4ef6\u6570\u6587select\u304c\u8d70\u308b\u306e\u3067\u4f7f\u3044\u3069\u3053\u308d\u306b\u6ce8\u610f\u304b\u3082\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rails\u3067model\u3092\u5229\u7528\u3059\u308b\u969b\u306bassociation\u5148\u3082\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3057\u305f\u3044\u5834\u5408\u306e\u65b9\u6cd5\u30e1\u30e2 \u300cas_json\u300d\u3092\u4f7f\u3063\u3066\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u5316\u3059\u308b\u969b\u306bassociation\u5148\u3082\u542b\u3081\u308b \u305f\u3060\u3001\u89aa\u30ec\u30b3\u30fc\u30c9\u4ef6\u6570\u6587select\u304c\u8d70\u308b\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[100,99,60,101],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/578"}],"collection":[{"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/comments?post=578"}],"version-history":[{"count":1,"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/578\/revisions"}],"predecessor-version":[{"id":579,"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/578\/revisions\/579"}],"wp:attachment":[{"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/media?parent=578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/categories?post=578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lizefieldwp.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/tags?post=578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}