{"id":172485,"date":"2024-05-08T17:51:37","date_gmt":"2024-05-08T09:51:37","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/172485.html"},"modified":"2024-05-08T17:51:57","modified_gmt":"2024-05-08T09:51:57","slug":"ruby-china%e6%98%af%e7%94%a8%e4%bb%80%e4%b9%88%e5%86%99%e7%9a%84%e9%9a%be%e4%b9%88","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/172485.html","title":{"rendered":"Ruby China\u662f\u7528\u4ec0\u4e48\u5199\u7684\u96be\u4e48"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27044047\/0a62e3a2-86a6-44d3-b011-2c41f54b9a53.webp\" alt=\"Ruby China\u662f\u7528\u4ec0\u4e48\u5199\u7684\u96be\u4e48\" \/><\/p>\n<p><p><strong>Ruby China\u662f\u7528Ruby\u8bed\u8a00\u4ee5\u53caRuby on R<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ls\u6846\u67b6\u7f16\u5199\u7684\uff0c\u5bf9\u4e8e\u719f\u6089Rails\u5f00\u53d1\u7684\u7a0b\u5e8f\u5458\u6765\u8bf4\uff0c\u5e76\u4e0d\u96be\u3002<\/strong> \u5f53\u6211\u4eec\u8c08\u8bba\u5f00\u53d1\u4e00\u4e2a\u7c7b\u4f3cRuby China\u7684\u793e\u533a\u65f6\uff0c\u91cd\u8981\u7684\u662f\u8003\u8651\u5230\u6846\u67b6\u7684\u6210\u719f\u5ea6\u3001\u793e\u533a\u652f\u6301\u548c\u5f00\u53d1\u8005\u7684\u719f\u6089\u7a0b\u5ea6\u3002Ruby on Rails\u88ab\u8bbe\u8ba1\u4e3a\u5feb\u901f\u5f00\u53d1\u6570\u636e\u5e93\u540e\u7aef\u7684\u5e94\u7528\uff0c\u800c\u4e14\u5176\u201c\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e\u201d\u7684\u539f\u5219\u53ef\u4ee5\u6781\u5927\u5730\u7b80\u5316\u4ee3\u7801\u548c\u5f00\u53d1\u6d41\u7a0b\u3002\u5b83\u7684\u5185\u7f6e\u529f\u80fd\u5982ActiveRecord\uff08\u6570\u636e\u5e93ORM\uff09\u3001ActionPack\uff08\u89c6\u56fe\u548c\u63a7\u5236\u5668\u7ed1\u5b9a\uff09\u3001ActiveJob\uff08\u540e\u53f0\u4efb\u52a1\uff09\u7b49\uff0c\u90fd\u662f\u6784\u5efa\u73b0\u4ee3web\u5e94\u7528\u6240\u9700\u7684\u91cd\u8981\u7ec4\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001<strong>\u6838\u5fc3\u6280\u672f\u6808\u7b80\u4ecb<\/strong><\/p>\n<\/p>\n<p><p>Ruby on Rails\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90Web\u5e94\u7528\u6846\u67b6\uff0c\u7531David Heinemeier Hansson\u57282004\u5e74\u53d1\u5e03\u3002Rails\u91c7\u53d6\u4e86\u4e00\u79cd\u4e0d\u540c\u4e8e\u4f20\u7edfWeb\u5f00\u53d1\u7684\u65b9\u6cd5\uff0c\u5021\u5bfc\u201c\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e\u201d\u7684\u539f\u5219\u4ee5\u53ca\u4f7f\u7528MVC\uff08Model-View-Controller\uff09\u67b6\u6784\u6a21\u5f0f\u3002Ruby\u4f5c\u4e3a\u4e00\u79cd\u52a8\u6001\u3001\u9762\u5411\u5bf9\u8c61\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u63d0\u4f9b\u4e86\u7f16\u5199\u7b80\u6d01\u4e0e\u7075\u6d3b\u4ee3\u7801\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001<strong>\u793e\u533a\u529f\u80fd\u4e0e\u67b6\u6784\u7ec4\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>Ruby China\u4f5c\u4e3a\u4e00\u4e2a\u8ba8\u8bbaRuby\u7a0b\u5e8f\u8bed\u8a00\u7684\u5e73\u53f0\uff0c\u5b83\u7684\u57fa\u672c\u793e\u533a\u529f\u80fd\u5e94\u8be5\u5305\u62ec\u7528\u6237\u8ba4\u8bc1\u3001\u8bba\u575b\u5e16\u5b50\u3001\u8bc4\u8bba\u4e92\u52a8\u3001\u7528\u6237\u4e2a\u4eba\u8d44\u6599\u4ee5\u53ca\u901a\u77e5\u7cfb\u7edf\u7b49\u3002\u8fd9\u4e9b\u529f\u80fd\u7684\u5b9e\u73b0\u9700\u8981\u7efc\u5408\u8fd0\u7528Rails\u63d0\u4f9b\u7684\u591a\u79cd\u7ec4\u4ef6\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u7528\u6237\u8ba4\u8bc1\u4e0e\u7ba1\u7406\uff1a<\/strong> Devise\u662f\u4e00\u4e2a\u57fa\u4e8eRails\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u7528\u4e8e\u5feb\u901f\u5b9e\u73b0\u7528\u6237\u8ba4\u8bc1\u7684\u529f\u80fd\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u9f50\u5168\u7684\u7528\u6237\u8ba4\u8bc1\u7cfb\u7edf\uff0c\u53ef\u7528\u4e8e\u7528\u6237\u6ce8\u518c\u3001\u767b\u5f55\u3001\u5bc6\u7801\u627e\u56de\u3001\u90ae\u4ef6\u786e\u8ba4\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bba\u575b\u5e16\u5b50\uff1a<\/strong> Rails\u7684ActiveRecord ORM\u80fd\u591f\u5e2e\u52a9\u5f00\u53d1\u8005\u9ad8\u6548\u5730\u7ba1\u7406\u548c\u67e5\u8be2\u6570\u636e\u5e93\u4e2d\u7684\u5e16\u5b50\u6570\u636e\u3002\u914d\u5408ActionView\uff0c\u53ef\u4ee5\u5feb\u901f\u6784\u5efa\u5e16\u5b50\u7684\u5c55\u793a\u754c\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u4e09\u3001<strong>\u6570\u636e\u5e93\u8bbe\u8ba1\u4e0e\u4f18\u5316<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4efb\u4f55\u793e\u533a\u5e73\u53f0\uff0c\u6570\u636e\u662f\u6838\u5fc3\u3002\u56e0\u6b64\uff0c\u6570\u636e\u5e93\u7684\u8bbe\u8ba1\u548c\u4f18\u5316\u5bf9Ruby China\u7684\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002Rails\u7684\u6570\u636e\u5e93\u8fc1\u79fb\uff08Migrations\uff09\u548c\u6a21\u5f0f\uff08Schemas\uff09\u4f7f\u5f97\u6570\u636e\u5e93\u53d8\u66f4\u5728\u5f00\u53d1\u56e2\u961f\u4e2d\u7684\u540c\u6b65\u53d8\u5f97\u66f4\u4e3a\u9ad8\u6548\u548c\u4e00\u81f4\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u9ad8\u6548\u7684\u6570\u636e\u7d22\u5f15\uff1a<\/strong> \u4e3a\u4e86\u63d0\u5347\u67e5\u8be2\u901f\u5ea6\uff0c\u91cd\u8981\u7684\u5b57\u6bb5\u6bd4\u5982\u7528\u6237ID\u3001\u5e16\u5b50\u6807\u9898\u7b49\u9700\u8981\u5efa\u7acb\u7d22\u5f15\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f13\u5b58\u7b56\u7565\uff1a<\/strong> \u501f\u52a9Rails\u7684\u7f13\u5b58\u673a\u5236\uff0c\u53ef\u4ee5\u5b9e\u73b0\u9875\u9762\u7ea7\u522b\u3001\u52a8\u4f5c\u7ea7\u522b\u6216\u8005\u7247\u6bb5\u7ea7\u522b\u7684\u7f13\u5b58\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u56db\u3001<strong>\u524d\u7aef\u6280\u672f\u548c\u7528\u6237\u4f53\u9a8c<\/strong><\/p>\n<\/p>\n<p><p>\u867d\u7136\u540e\u7aef\u529f\u80fd\u5f3a\u5927\uff0c\u4f46\u4e00\u4e2a\u6210\u529f\u7684\u793e\u533a\u79bb\u4e0d\u5f00\u4f18\u79c0\u7684\u524d\u7aef\u5c55\u793a\u548c\u7528\u6237\u4f53\u9a8c\u3002Rails\u7684Asset Pipeline\u4e3aCSS\u3001JavaScript\u548c\u56fe\u7247\u8d44\u6e90\u7684\u7ec4\u7ec7\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u6548\u7684\u7ba1\u7406\u7cfb\u7edf\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u54cd\u5e94\u5f0f\u8bbe\u8ba1\uff1a<\/strong> \u901a\u8fc7Bootstrap\u6216\u5176\u4ed6\u524d\u7aef\u6846\u67b6\uff0c\u4fdd\u8bc1Ruby China\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u90fd\u80fd\u6709\u826f\u597d\u8868\u73b0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ea4\u4e92\u4f53\u9a8c\uff1a<\/strong> \u901a\u8fc7\u4f7f\u7528CoffeeScript\u548cTurbolinks\u7b49\u6280\u672f\uff0c\u53ef\u63d0\u5347\u9875\u9762\u52a0\u8f7d\u901f\u5ea6\u548c\u7528\u6237\u7684\u4ea4\u4e92\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u4e94\u3001<strong>\u5b89\u5168\u6027\u80fd\u8003\u8651<\/strong><\/p>\n<\/p>\n<p><p>Web\u5e94\u7528\u5b89\u5168\u662f\u6bcf\u4e2a\u5f00\u53d1\u8005\u5fc5\u987b\u8003\u8651\u7684\u95ee\u9898\u3002Ruby on Rails\u81ea\u8eab\u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u6709\u529b\u7684\u5b89\u5168\u673a\u5236\u3002 <\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>CSRF\u9632\u62a4\uff1a<\/strong> Rails\u5185\u5efa\u7684\u9632\u62a4\u63aa\u65bd\u80fd\u6709\u6548\u907f\u514d\u8de8\u7ad9\u8bf7\u6c42\u4f2a\u9020\u653b\u51fb\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>SQL\u6ce8\u5165\u9884\u9632\uff1a<\/strong> ActiveRecord\u63d0\u4f9b\u7684\u67e5\u8be2\u65b9\u6cd5\u53ef\u4ee5\u786e\u4fdd\u4f20\u5165\u7684\u53c2\u6570\u88ab\u6b63\u786e\u5730\u8f6c\u4e49\uff0c\u51cf\u5c11SQL\u6ce8\u5165\u7684\u98ce\u9669\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u516d\u3001<strong>\u6269\u5c55\u6027\u548c\u7ef4\u62a4\u6027<\/strong><\/p>\n<\/p>\n<p><p>\u6784\u5efa\u4e00\u4e2a\u50cfRuby China\u8fd9\u6837\u7684\u793e\u533a\uff0c\u4e0d\u4ec5\u9700\u8981\u8003\u8651\u5176\u5f53\u524d\u7684\u529f\u80fd\u5b9e\u73b0\uff0c\u66f4\u9700\u8981\u9884\u89c1\u672a\u6765\u7684\u6269\u5145\u548c\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u4ee3\u7801\u6a21\u5757\u5316\uff1a<\/strong> \u901a\u8fc7Rails\u7684\u5173\u6ce8\u70b9\u5206\u79bb\uff0c\u53ef\u4ee5\u8ba9\u4e0d\u540c\u7684\u529f\u80fd\u6a21\u5757\u5316\uff0c\u4fbf\u4e8e\u672a\u6765\u7684\u6269\u5c55\u548c\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u81ea\u52a8\u5316\u6d4b\u8bd5\uff1a<\/strong> Rails\u9f13\u52b1\u4f7f\u7528TDD\uff08\u6d4b\u8bd5\u9a71\u52a8\u5f00\u53d1\uff09\uff0c\u901a\u8fc7\u7f16\u5199\u81ea\u52a8\u5316\u6d4b\u8bd5\u6765\u786e\u4fdd\u5e94\u7528\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u4e03\u3001<strong>\u793e\u533a\u7684\u6d3b\u8dc3\u5ea6\u4e0e\u8fd0\u8425\u7b56\u7565<\/strong><\/p>\n<\/p>\n<p><p>\u6280\u672f\u5b9e\u73b0\u4e4b\u5916\uff0cRuby China\u7684\u6210\u529f\u8fd8\u9700\u8981\u826f\u597d\u7684\u5185\u5bb9\u548c\u6d3b\u8dc3\u7684\u793e\u533a\u6c1b\u56f4\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5185\u5bb9\u7684\u8d28\u91cf\u63a7\u5236\uff1a<\/strong> \u9f13\u52b1\u7528\u6237\u53d1\u8868\u9ad8\u8d28\u91cf\u7684\u8ba8\u8bba\u5e16\u5b50\uff0c\u5bf9\u4e8e\u7ba1\u7406\u56e2\u961f\u6765\u8bf4\uff0c\u5236\u5b9a\u76f8\u5e94\u7684\u5185\u5bb9\u89c4\u8303\u662f\u5fc5\u8981\u7684\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7528\u6237\u6fc0\u52b1\u673a\u5236\uff1a<\/strong> \u8bbe\u8ba1\u79ef\u5206\u4f53\u7cfb\u3001\u5fbd\u7ae0\u5956\u52b1\u7b49\uff0c\u53ef\u4ee5\u6fc0\u52b1\u7528\u6237\u79ef\u6781\u53c2\u4e0e\u793e\u533a\u5efa\u8bbe\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0c<strong>Ruby China\u7684\u6784\u5efa\u6d89\u53ca\u6280\u672f\u5b9e\u73b0\u548c\u793e\u533a\u7ba1\u7406\u4e24\u5927\u90e8\u5206<\/strong>\u3002\u8be5\u5e73\u53f0\u4e0d\u4ec5\u5c55\u793a\u4e86Ruby on Rails\u6846\u67b6\u7684\u5f3a\u5927\u6613\u7528\u6027\uff0c\u540c\u65f6\u4e5f\u51f8\u663e\u4e86\u826f\u597d\u793e\u533a\u6587\u5316\u548c\u8fd0\u8425\u5bf9\u4e8e\u7528\u6237\u6d3b\u8dc3\u5ea6\u7684\u91cd\u8981\u6027\u3002\u5bf9\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u501f\u9274Ruby China\u7684\u67b6\u6784\u6a21\u5f0f\u548c\u793e\u533a\u7b56\u7565\uff0c\u53ef\u4ee5\u4e3a\u6784\u5efa\u7c7b\u4f3c\u793e\u533a\u63d0\u4f9b\u6709\u4ef7\u503c\u7684\u53c2\u8003\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>Ruby China\u662f\u4f7f\u7528Ruby on Rails\u6846\u67b6\u5f00\u53d1\u7684\u3002<\/strong><\/p>\n<ol>\n<li>\n<p><strong>Ruby China\u4f7f\u7528\u7684\u662f\u54ea\u4e2a\u7248\u672c\u7684Ruby on Rails\u6846\u67b6\uff1f<\/strong><br \/>\nRuby China\u76ee\u524d\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672c\u7684Ruby on Rails\u6846\u67b6\u3002\u8fd9\u4e2a\u6846\u67b6\u662f\u7531Ruby\u8bed\u8a00\u5f00\u53d1\u7684\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957\u4fbf\u6377\u7684\u5de5\u5177\u548c\u529f\u80fd\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u80fd\u591f\u5feb\u901f\u6784\u5efaWeb\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4e3a\u4ec0\u4e48\u9009\u62e9Ruby on Rails\u6765\u5f00\u53d1Ruby China\uff1f<\/strong><br \/>\nRuby on Rails\u6846\u67b6\u6709\u5f88\u591a\u4f18\u70b9\uff0c\u6bd4\u5982\u9ad8\u6548\u7684\u5f00\u53d1\u901f\u5ea6\u3001\u7b80\u6d01\u7684\u4ee3\u7801\u7ed3\u6784\u3001\u5f3a\u5927\u7684\u6570\u636e\u5e93\u8bbf\u95ee\u80fd\u529b\u7b49\u3002\u8fd9\u4e9b\u7279\u70b9\u4f7f\u5f97\u5f00\u53d1\u56e2\u961f\u9009\u62e9\u4e86Ruby on Rails\u6765\u5f00\u53d1Ruby China\uff0c\u4ee5\u4fbf\u80fd\u591f\u5feb\u901f\u8fed\u4ee3\u548c\u66f4\u65b0\u529f\u80fd\uff0c\u540c\u65f6\u786e\u4fdd\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u53ef\u6269\u5c55\u6027\u3002<\/p>\n<\/li>\n<li>\n<p><strong>Ruby on Rails\u6846\u67b6\u5728Ruby China\u4e2d\u8d77\u5230\u4e86\u4ec0\u4e48\u4f5c\u7528\uff1f<\/strong><br \/>\nRuby on Rails\u6846\u67b6\u5728Ruby China\u4e2d\u53d1\u6325\u4e86\u5173\u952e\u7684\u4f5c\u7528\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684MVC\uff08\u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668\uff09\u67b6\u6784\uff0c\u4f7f\u5f97\u5f00\u53d1\u56e2\u961f\u80fd\u591f\u5c06\u4e1a\u52a1\u903b\u8f91\u3001\u7528\u6237\u754c\u9762\u548c\u6570\u636e\u5e93\u64cd\u4f5c\u8fdb\u884c\u6709\u6548\u5730\u5206\u79bb\u3002\u540c\u65f6\uff0cRuby on Rails\u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u5f88\u591a\u5f3a\u5927\u7684\u5de5\u5177\u548c\u63d2\u4ef6\uff0c\u7b80\u5316\u4e86\u5f00\u53d1\u6d41\u7a0b\uff0c\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"Ruby China\u662f\u7528Ruby\u8bed\u8a00\u4ee5\u53caRuby on RAIls\u6846\u67b6\u7f16\u5199\u7684\uff0c\u5bf9\u4e8e\u719f\u6089Rails\u5f00\u53d1\u7684\u7a0b\u5e8f\u5458\u6765 [&hellip;]","protected":false},"author":3,"featured_media":172519,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/172485"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=172485"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/172485\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/172519"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=172485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=172485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=172485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}