{"id":2881,"date":"2016-02-18T19:27:40","date_gmt":"2016-02-18T11:27:40","guid":{"rendered":"http:\/\/blog.turn.tw\/?p=2881"},"modified":"2016-02-18T19:27:40","modified_gmt":"2016-02-18T11:27:40","slug":"%e7%b5%a6%e7%b6%b2%e7%ab%99%e5%88%9d%e5%ad%b8%e8%80%85%e7%9a%84%e5%bb%ba%e8%ad%b0%ef%bc%9a%e7%94%a8-ruby-on-rails-%e9%9d%9e%e5%b8%b8%e8%be%9b%e8%8b%a6%ef%bc%8c%e7%94%a8-php-%e9%9d%9e%e5%b8%b8%e8%88%92","status":"publish","type":"post","link":"https:\/\/blog.turn.tw\/?p=2881","title":{"rendered":"\u7d66\u7db2\u7ad9\u521d\u5b78\u8005\u7684\u5efa\u8b70\uff1a\u7528 Ruby on Rails \u975e\u5e38\u8f9b\u82e6\uff0c\u7528 PHP \u975e\u5e38\u8212\u670d"},"content":{"rendered":"<p>Rails\u662f\u65b0\u624b\u5165\u9580\u5b78\u5beb\u7db2\u7ad9\u6700\u8f9b\u82e6\u7684\u9078\u64c7\u4e4b\u4e00\u3002<\/p>\n<p>\u5e38\u5e38\u6709\u6587\u7ae0\u6216\u662f\u8ab2\u7a0b\u5efa\u8b70\u65b0\u624b\u7528Rails\u5165\u9580\u5beb\u7db2\u7ad9\uff0c\u6211\u8a8d\u70ba\u9019\u7a2e\u5efa\u8b70\u5341\u5206\u5371\u96aa\u3002<\/p>\n<p>Rails\u4e26\u4e0d\u9069\u5408\u521d\u5b78\u8005\u4f7f\u7528\u3002\u63a8\u85a6\u6c92\u6709\u8cc7\u8a0a\u80cc\u666f\u7684\u4eba\u53bb\u5b78Rails\uff0c\u5f88\u53ef\u80fd\u5bb3\u4ed6\u4e8b\u500d\u529f\u534a\u3002<\/p>\n<h1>\u65b0\u624b\u7528Rails\u5165\u9580\u7684\u554f\u984c\u5728\u54ea\uff1f<\/h1>\n<p>Rails\u6700\u5927\u7684\u554f\u984c\u5c31\u5728\u65bc\uff1a\u5b83\u5f9e\u4e00\u958b\u59cb\u5c31\u4e0d\u662f\u8a2d\u8a08\u7d66\u65b0\u624b\u7528\u7684\u3002<\/p>\n<p>\u5b83\u662f\u8a2d\u8a08\u7d66\u5de5\u7a0b\u5e2b\u5feb\u901f\u958b\u767c\u7528\u7684\u3002<\/p>\n<p>\u8edf\u9ad4\u5de5\u7a0b\u6c92\u6709\u842c\u9748\u4e39\u3002\u9069\u5408\u8001\u624b\u7684\uff0c\u5c0d\u65b0\u624b\u4f86\u8aaa\u4e00\u5b9a\u592a\u96e3\uff1b\u9069\u5408\u65b0\u624b\u7684\uff0c\u5c0d\u8001\u624b\u4f86\u8aaa\u4e00\u5b9a\u592a\u56c9\u5506\u3002<\/p>\n<p>Rails\u70ba\u4e86\u66ff\u5de5\u7a0b\u5e2b\u7bc0\u7701\u53cd\u8986\u8a2d\u5b9a\uff08configuration\uff09\u7684\u6642\u9593\uff0c\u800c\u9810\u8a2d\u4e86\u8a31\u591a\u7acb\u5834\uff08convention\uff09\u3002<\/p>\n<p>\u65b0\u624b\u9023web application\u7684\u57fa\u672c\u77e5\u8b58\u3001\u74b0\u5883\u8a2d\u5b9a\u90fd\u4e0d\u77e5\u9053\uff0c<\/p>\n<p>\u76f4\u63a5\u53bb\u5b78\u524d\u4eba\u7684framework\u548cconvention\uff0c\u7d55\u5c0d\u4e0d\u662f\u597d\u4e8b\uff0c\u4e5f\u975e\u5e38\u8f9b\u82e6\u3002<\/p>\n<p>\u6211\u5011\u5f9eRails\u7684\u5b98\u65b9\u5165\u9580\u5c0e\u89bd\u4f86\u8209\u4f8b\u5427\uff1a<\/p>\n<p><a href='http:\/\/guides.rubyonrails.org\/getting_started.html'>http:\/\/guides.rubyonrails.org\/getting_started.html<\/a><\/p>\n<p>\u5c0d\u65b0\u624b\u4f86\u8aaa\uff0c\u9019\u4efd\u5c0e\u89bd\u771f\u662f\u5145\u6eff\u4e86\u707d\u96e3\u3002<\/p>\n<p>\u5b83\u5c31\u8ddf\u5927\u90e8\u4efd\u7684rails\u6559\u6750\u4e00\u6a23\uff0c\u6703\u5e36\u65b0\u624b\u53bb\u5b78\u5f88\u6c92\u5fc5\u8981\u76844\u4ef6\u4e8b\u60c5\uff1a<\/p>\n<p>1. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78\u6846\u67b6\u7684\u6a94\u6848\u7d50\u69cb<br \/>\n2. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78\u6846\u67b6\u7684command line\u6307\u4ee4<br \/>\n3. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78helper<br \/>\n4. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78migration<\/p>\n<h2>1. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78\u6846\u67b6\u7684\u6a94\u6848\u7d50\u69cb<\/h2>\n<p>\u65b0\u624b\u6253\u958b\u5c0e\u89bd\u4e4b\u5f8c\uff0c\u6620\u5165\u773c\u7c3e\u7684\uff0c\u662f\u9019\u500b\u4ecb\u7d39\u6a94\u6848\u7d50\u69cb\u7684\u5687\u4eba\u8868\u683c\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>File\/Folder<\/th>\n<th>Purpose<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>app\/<\/td>\n<td>Contains the controllers, models, views, helpers, mailers and assets for your application. You&#8217;ll focus on this folder for the remainder of this guide.<\/td>\n<\/tr>\n<tr>\n<td>bin\/<\/td>\n<td>Contains the rails script that starts your app and can contain other scripts you use to setup, deploy or run your application.<\/td>\n<\/tr>\n<tr>\n<td>config\/<\/td>\n<td>Configure your application&#8217;s routes, database, and more. This is covered in more detail in <a href=\"configuring.html\">Configuring Rails Applications<\/a>.<\/td>\n<\/tr>\n<tr>\n<td>config.ru<\/td>\n<td>Rack configuration for Rack based servers used to start the application.<\/td>\n<\/tr>\n<tr>\n<td>db\/<\/td>\n<td>Contains your current database schema, as well as the database migrations.<\/td>\n<\/tr>\n<tr>\n<td>Gemfile<br \/>Gemfile.lock<\/td>\n<td>These files allow you to specify what gem dependencies are needed for your Rails application. These files are used by the Bundler gem. For more information about Bundler, see the <a href=\"http:\/\/bundler.io\">Bundler website<\/a>.<\/td>\n<\/tr>\n<tr>\n<td>lib\/<\/td>\n<td>Extended modules for your application.<\/td>\n<\/tr>\n<tr>\n<td>log\/<\/td>\n<td>Application log files.<\/td>\n<\/tr>\n<tr>\n<td>public\/<\/td>\n<td>The only folder seen by the world as-is. Contains static files and compiled assets.<\/td>\n<\/tr>\n<tr>\n<td>Rakefile<\/td>\n<td>This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib\/tasks directory of your application.<\/td>\n<\/tr>\n<tr>\n<td>README.rdoc<\/td>\n<td>This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on.<\/td>\n<\/tr>\n<tr>\n<td>test\/<\/td>\n<td>Unit tests, fixtures, and other test apparatus. These are covered in <a href=\"testing.html\">Testing Rails Applications<\/a>.<\/td>\n<\/tr>\n<tr>\n<td>tmp\/<\/td>\n<td>Temporary files (like cache, pid, and session files).<\/td>\n<\/tr>\n<tr>\n<td>vendor\/<\/td>\n<td>A place for all third-party code. In a typical Rails application this includes vendored gems.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u521d\u5b78\u8005\u4e00\u958b\u59cb\u53ea\u60f3\u505a\u500b\u90e8\u843d\u683c\u6216\u662f\u500b\u4eba\u7db2\u9801\u800c\u5df2\uff0c\u771f\u7684\u6709\u5fc5\u8981\u53bb\u9762\u5c0d\u9019\u9ebc\u591a\u6a94\u6848\u55ce\uff1f<\/p>\n<p>\u9019\u7a2e\u67b6\u69cb\u662f\u6846\u67b6\u66ff\u5de5\u7a0b\u5e2b\u7684\u8edf\u9ad4\u5c08\u6848\u9577\u9060\u8457\u60f3\uff0c\u800c\u8a73\u7d30\u5206\u5de5\u7684\u7d50\u679c\u3002<\/p>\n<p>\u65b0\u624b\u4e26\u6c92\u6709\u8981\u958b\u767c\u5927\u578b\u5c08\u6848\uff0c\u505a\u51fa\u5e7e\u500b\u80fd\u8dd1\u80fd\u52d5\u7684\u9801\u9762\u5c31\u5920\u4e86\u3002<\/p>\n<p>\u7d50\u69cb\u6216\u662f\u7a0b\u5f0f\u78bc\u919c\u4e00\u9ede\u7121\u6240\u8b02\uff0c\u597d\u4e0a\u624b\u5c31\u597d\uff0c\u5be6\u5728\u6c92\u5fc5\u8981\u4e00\u958b\u59cb\u5c31\u78b0\u9019\u9ebc\u8907\u96dc\u7684\u3002<\/p>\n<h2>2. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78\u6846\u67b6\u7684 command line\u6307\u4ee4<\/h2>\n<p>\u5b98\u65b9\u5c0e\u89bd\u4ecb\u7d39\u4e86\u7522\u751fcontroller\u76f8\u95dc\u6a94\u6848\u7684\u6307\u4ee4\uff1a<\/p>\n<pre>\r\n$ bin\/rails generate controller welcome index\r\n<\/pre>\n<p>\u7136\u5f8crails\u6703\u986f\u793a\u4ee5\u4e0b\u8a0a\u606f\uff1a<\/p>\n<pre>\r\ncreate  app\/controllers\/welcome_controller.rb\r\n route  get 'welcome\/index'\r\ninvoke  erb\r\ncreate    app\/views\/welcome\r\ncreate    app\/views\/welcome\/index.html.erb\r\ninvoke  test_unit\r\ncreate    test\/controllers\/welcome_controller_test.rb\r\ninvoke  helper\r\ncreate    app\/helpers\/welcome_helper.rb\r\ninvoke  assets\r\ninvoke    coffee\r\ncreate      app\/assets\/javascripts\/welcome.js.coffee\r\ninvoke    scss\r\ncreate      app\/assets\/stylesheets\/welcome.css.scss\r\n<\/pre>\n<p>\u53ea\u4e0d\u904e\u60f3\u505a\u500b\u7c21\u55ae\u9801\u9762\uff0c\u5c45\u7136\u8dd1\u51fa\u4e86\u597d\u5e7e\u500b\u6a94\u6848\u3002\u5c0d\u65b0\u624b\u4f86\u8aaa\uff0c\u9019\u975e\u5e38\u4e0d\u53cb\u5584\u3002<\/p>\n<p>\u65b0\u624b\u60f3\u8981\u7684\uff0c\u662f\u5728\u8cc7\u6599\u593e\u88e1\u9762\u4e00\u6b21\u5efa\u7acb\u4e00\u500b\u6a94\u6848\uff0c\u7136\u5f8c\u5728\u88e1\u9762\u5beb\u4e00\u9ede\u6771\u897f\u3002<\/p>\n<p>\u63a5\u8457\u770b\u770b\u7a0b\u5f0f\u6709\u4ec0\u9ebc\u53cd\u61c9\u3001\u8dd1\u4e0d\u8dd1\u5f97\u52d5\u3002\u9019\u6a23\u4ed6\u624d\u77e5\u9053\u81ea\u5df1\u5728\u505a\u4ec0\u9ebc\u3001\u5728\u5b78\u4ec0\u9ebc\u3002<\/p>\n<p>\u50cf\u9019\u7a2e\u6253\u4e00\u500b\u6307\u4ee4\u7522\u751f\u4e00\u5806\u6a94\u6848\u7684\u5b78\u7fd2\u65b9\u6cd5\uff0c\u5c31\u7b97\u771f\u7684\u300c\u5feb\u901f\u505a\u51fa\u4e86\u4e00\u9ede\u6771\u897f\u300d\uff0c<\/p>\n<p>\u4e4b\u5f8c\u5927\u6982\u9023\u600e\u9ebc\u4fee\u6539\u7a0b\u5f0f\u90fd\u4e0d\u77e5\u9053\u3002\u5982\u6b64\u9ed1\u7bb1\uff0c\u5f88\u5bb9\u6613\u5e36\u4f86\u632b\u6298\u611f\u3002<\/p>\n<h2>3. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78helper<\/h2>\n<p>\u5b98\u65b9\u5c0e\u89bd\u63d0\u5230\u4e86Form\u7684\u5beb\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>\r\n<%= form_for :article do |f| %>\r\n  <p>\r\n    <%= f.label :title %><br>\r\n    <%= f.text_field :title %>\r\n  <\/p>\r\n \r\n  <p>\r\n    <%= f.label :text %><br>\r\n    <%= f.text_area :text %>\r\n  <\/p>\r\n \r\n  <p>\r\n    <%= f.submit %>\r\n  <\/p>\r\n<% end %>\r\n<\/pre>\n<p>\u9019\u5b8c\u5168\u662f\u707d\u96e3\u4e00\u5834\u3002<\/p>\n<p>\u65b0\u624b\u8a72\u5b78\u7684\u4e0d\u662f\u9019\u7a2eERB\u8a9e\u6cd5\uff0c\u800c\u662f\u539f\u59cbHTML\u7684Form element\u8a9e\u6cd5\uff1a<\/p>\n<pre>\r\n<form>\r\n    <label>title<\/label>\r\n    <input \/>\r\n    <label>text<\/label>\r\n    <textarea><\/textarea>\r\n<\/form>\r\n<\/pre>\n<p>Form element\u7684\u8a9e\u6cd5\u4e00\u9ede\u90fd\u4e0d\u96e3\uff0c\u7db2\u8def\u4e0a<a href='http:\/\/www.w3schools.com\/html\/html_form_elements.asp'>\u5230\u8655\u627e\u90fd\u6709<\/a>\u3002<\/p>\n<p>\u65b0\u624b\u5b78HTML\u57fa\u672c\u77e5\u8b58\u5c31\u5920\u4e86\u3002\u63a5\u8457\u518d\u5b78\u4e00\u4e9bHTTP\u7684\u57fa\u672c\u77e5\u8b58\uff0c\u4e86\u89e3\u700f\u89bd\u5668\u5982\u4f55\u5c07\u8868\u55ae\u7684\u8cc7\u6599\u4e1f\u7d66\u5f8c\u7aef\u7a0b\u5f0f\u4e92\u52d5\u3002<\/p>\n<p>\u5b78\u9019\u4e9b\u57fa\u672c\u77e5\u8b58\u624d\u8e0f\u5be6\u3001\u624d\u6709\u6210\u5c31\u611f\u3002<\/p>\n<p>helper\u662f\u5de5\u7a0b\u5e2b\u70ba\u4e86\u5c11\u5bebHTML\u800c\u4f7f\u7528\u7684\u9032\u968e\u5de5\u5177\u3002<\/p>\n<p>\u521d\u5b78\u8005\u9023\u57fa\u672c\u7684HTML\u90fd\u4e0d\u6703\uff0c\u5b78\u4ec0\u9ebchelper\uff1f\u5f92\u7136\u589e\u52a0\u632b\u6298\u611f\u800c\u5df2\u3002<\/p>\n<h2>4. \u65b0\u624b\u6c92\u5fc5\u8981\u5b78migration<\/h2>\n<p>migration\u662f\u5de5\u7a0b\u5e2b\u65b9\u4fbf\u7ba1\u7406\u8cc7\u6599\u5eab\u7d50\u69cb\u7684\u7248\u672c\uff0c\u4ee5\u53ca\u5728\u5718\u968a\u6210\u54e1\u9593\u540c\u6b65\u5316\u7684\u5de5\u5177\u3002<\/p>\n<p>\u521d\u5b78\u8005\u6839\u672c\u6c92\u6709\u9019\u7a2e\u7ba1\u7406\u8cc7\u6599\u5eab\u7684\u9700\u6c42\u3002<\/p>\n<p>\u65b0\u624b\u5982\u679c\u8981\u5b78\u8cc7\u6599\u5eab\u64cd\u4f5c\uff0c\u61c9\u8a72\u53bb\u5b78\u8cc7\u6599\u5eab\u8edf\u9ad4\uff08\u8b6c\u5982\u8aaaMySQL\uff09\u672c\u8eab\u7684\u8a9e\u6cd5\uff0c\u9019\u6a23\u624d\u6703\u6709\u5b78\u5230\u8cc7\u6599\u5eab\u64cd\u4f5c\u7684\u624e\u5be6\u611f\u89ba\u3002<\/p>\n<p>\u5982\u679c\u662f\u4e00\u958b\u59cb\u4e0d\u60f3\u5b78\u8cc7\u6599\u5eab\u8a9e\u6cd5\u7684\u65b0\u624b\uff0c\u90a3\u66f4\u4e0d\u61c9\u8a72\u53bb\u5b78migration\u3002<\/p>\n<p>\u4ed6\u61c9\u8a72\u53bb\u5b89\u88dd\u4e00\u6b3e\u6709\u5716\u5f62\u5316\u4ecb\u9762\u7684\u8cc7\u6599\u5eab\u7ba1\u7406\u8edf\u9ad4\uff0c\u7528\u6ed1\u9f20\u6309\u4e00\u6309\u628a\u8cc7\u6599\u8868\u505a\u51fa\u4f86\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<h1>\u521d\u5b78\u8005\u6700\u8212\u670d\u7684\u5b78\u7fd2\u8def\u5f91\uff1aPHP + \u61f6\u4eba\u5305<\/h1>\n<p>\u521d\u5b78\u8005\u5c0d\u65bc\u958b\u767c\u7db2\u7ad9\u7684\u60f3\u50cf\uff0c\u4e0d\u5916\u4e4e\u5c31\u662f\u300c\u5beb\u5e7e\u884c\u7a0b\u5f0f\u78bc\uff0c\u505a\u51fa\u5e7e\u500b\u5c0f\u9801\u9762\u300d\u3002<\/p>\n<p>\u4ed6\u4e00\u958b\u59cb\u5c0d\u65bc\u74b0\u5883\u5b89\u88dd\u8207\u8abf\u6574\u6c92\u6709\u8208\u8da3\uff0c\u4e5f\u8ca0\u8377\u4e0d\u4f86\u3002<\/p>\n<p>\u9019\u500b\u6642\u5019\uff0c\u4f7f\u7528PHP\u642d\u914d\u61f6\u4eba\u5305\u958b\u767c\u6703\u662f\u6700\u8212\u670d\u7684\u8def\u5f91\u3002<\/p>\n<p>\u5b78\u5beb\u7db2\u7ad9\u81f3\u5c11\u8981\u78b0\u5e7e\u500b\u6771\u897f\uff1a<\/p>\n<ul>\n<li> HTML<\/li>\n<li> CSS<\/li>\n<li> client-side programming (JavaScript)<\/li>\n<li> server-side programming (ex: Ruby on Rails \u6216\u662f PHP)<\/li>\n<li> \u8cc7\u6599\u5eab<\/li>\n<li> \u67b6server<\/li>\n<\/ul>\n<p>\u6211\u5c0d\u65b0\u624b\u5b78\u7fd2\u7684\u5efa\u8b70\u662f\u9019\u6a23\u7684\uff1a<\/p>\n<p>1. HTML\u548cCSS\u5e7e\u4e4e\u6c92\u6709\u5165\u9580\u9580\u6abb\uff0c\u7dda\u4e0a\u96a8\u4fbf\u627e\u6559\u6750\u90fd\u6709\u3002<br \/>\n2. JavaScript\u4e3b\u8981\u662f\u7528\u4f86\u505a\u700f\u89bd\u5668\u4e0a\u7684\u4e00\u4e9b\u52d5\u614b\u6548\u679c\uff0c\u975e\u5fc5\u8981\u3002\u4e00\u958b\u59cb\u5148\u4e0d\u5b78\u3002<br \/>\n3. \u8cc7\u6599\u5eab\u8ddf\u67b6server\u4e00\u958b\u59cb\u8d85\u51fa\u65b0\u624b\u60f3\u50cf\uff0c\u53ef\u4ee5\u5148\u5b89\u88dd\u61f6\u4eba\u5305\u5e36\u904e\u3002<br \/>\n4. server-side programming\u624d\u662f\u65b0\u624b\u539f\u672c\u7406\u89e3\u7684\u300c\u5b78\u5beb\u7db2\u7ad9\u300d\u3002<\/p>\n<p>\u57fa\u65bc\u4ee5\u4e0a\u56db\u9ede\u5efa\u8b70\uff0c\u65b0\u624b\u4e00\u958b\u59cb\u628a\u5fc3\u529b\u653e\u57281\u30014\u5373\u53ef\uff0c\u7136\u5f8c\u5f9e\u4ee5\u4e0b\u61f6\u4eba\u5305\u64c7\u4e00\u5b89\u88dd\uff1a<\/p>\n<ul>\n<li> <a href='https:\/\/www.appservnetwork.com\/en\/'>AppServ<\/a><\/li>\n<li><a href='http:\/\/www.wampserver.com\/en\/'> Wamp<\/a><\/li>\n<li> <a href='https:\/\/www.apachefriends.org\/zh_tw\/index.html'>Xampp<\/a><\/li>\n<\/ul>\n<p>\u9019\u4e9b\u61f6\u4eba\u5305\u6703\u76f4\u63a5\u5e6b\u4f60\u88dd\u597dserver\u3001\u8cc7\u6599\u5eab\u8207PHP\u3002<\/p>\n<p>\u8cc7\u6599\u5eab\u76f8\u95dc\u7684\u64cd\u4f5c\u53ef\u4ee5\u5148\u900f\u904ephpMyAdmin\u4e4b\u985e\u7684\u8edf\u9ad4\u7528\u6ed1\u9f20\u64cd\u4f5c\u3002<\/p>\n<p>\u63a5\u8457\u5728\u7dda\u4e0a\u627ePHP\u6559\u5b78\u4e4b\u985e\u7684\u6771\u897f\uff0c\u4ee5\u300c\u4e00\u500b\u6a94\u6848\u5c31\u53ef\u4ee5\u505a\u51fa\u4e00\u500b\u7db2\u9801\u300d\u7684\u65b9\u5f0f\u958b\u59cb\u5b78\u7fd2\u3002<\/p>\n<p>\u5728\u61f6\u4eba\u5305\u7684\u5354\u52a9\u4e0b\uff0c\u6309\u7167\u8208\u8da3\u6162\u6162\u6478\u7d22HTML, CSS\u548cPHP\u7684\u77e5\u8b58\u3002<\/p>\n<p>\u4e4b\u5f8c\u518d\u6839\u64da\u76ee\u6a19\uff0c\u5f9e\u4ee5\u4e0b\u4e09\u500b\u65b9\u5411\u66f4\u9032\u4e00\u6b65\u5b78\u7fd2\uff1a<\/p>\n<ul>\n<li> \u6025\u8457\u8b93\u7db2\u7ad9\u4e0a\u7dda\u8005\uff0c\u53ef\u4ee5\u628a\u7a0b\u5f0f\u78bc\u4ea4\u7d66\u5de5\u7a0b\u5e2b\u670b\u53cb\uff0c\u8acb\u4ed6\u5e6b\u5fd9\u8cb7\u7db2\u5740\u3001\u67b6\u8d77\u4f86\u3002<\/li>\n<li> \u5c0dserver side\u5de5\u7a0b\u6709\u8208\u8da3\u8005\uff0c\u53ef\u4ee5\u88dc\u5f37\u8cc7\u6599\u5eab\u3001\u4f3a\u670d\u5668\u7b49\u7b49\u77e5\u8b58\u3002\u8a66\u8457\u4e0d\u4f9d\u9760\u61f6\u4eba\u5305\u5c31\u7368\u7acb\u641e\u5b9a\u74b0\u5883\u3001\u6311\u4e00\u500b\u6846\u67b6\u5b78\u7fd2\u4e4b\u985e\u7684\u3002<\/li>\n<li> \u5c0dclient side\u5de5\u7a0b\u6709\u8208\u8da3\u8005\uff0c\u53ef\u4ee5\u88dc\u5f37JavaScript\u7684\u77e5\u8b58\uff0c\u5b78\u7fd2\u524d\u7aef\u76f8\u95dc\u77e5\u8b58\u3002<\/li>\n<\/ul>\n<p>\u5165\u9580\u6700\u91cd\u8981\u7684\u662f\u5faa\u5e8f\u6f38\u9032\uff0c\u5148\u60f3\u8fa6\u6cd5\u505a\u51fa\u4e00\u500b\u80fd\u52d5\u7684\u7db2\u7ad9\uff0c<\/p>\n<p>\u4e4b\u5f8c\u518d\u6839\u64da\u9700\u6c42\uff0c\u628a\u7f3a\u5c11\u7684\u6280\u80fd\u4e00\u500b\u4e00\u500b\u88dc\u8d77\u4f86\u3002<\/p>\n<p>\u5728\u300c\u5be6\u4f5c\u51fa\u6210\u54c1\u300d\u8207\u300c\u5b78\u7fd2\u65b0\u77e5\u8b58\u300d\u4e4b\u9593\u4f86\u56de\u9032\u884c\uff0c\u53cd\u8986\u7d2f\u7a4d\u6210\u5c31\u611f\u8207\u80fd\u529b\u3002<\/p>\n<p>\u4e00\u53e3\u6c23\u5168\u90e8\u4e00\u8d77\u5b78\uff0c\u53ea\u6703\u975e\u5e38\u832b\u7136\u3001\u500d\u611f\u632b\u6298\u800c\u5df2\u3002\u6cc1\u4e14\u6839\u672c\u6c92\u6709\u5fc5\u8981\u3002<\/p>\n<p>\u7528Rails\u5c31\u66f4\u6158\u4e86\uff0c\u5728\u4e00\u958b\u59cb\u5c31\u5f97\u5b78\u4e00\u4e9b\u5de5\u7a0b\u5e2b\u7528\u7684\u9032\u968e\u624b\u6cd5\u3002<\/p>\n<p>\u7e3d\u7d50\u8d77\u4f86\uff0c\u6211\u7d66\u7db2\u7ad9\u521d\u5b78\u8005\u7684\u5efa\u8b70\u5c31\u662f\uff1a\u7528 Ruby on Rails \u975e\u5e38\u8f9b\u82e6\uff0c\u7528 PHP \u975e\u5e38\u8212\u670d\u3002<\/p>\n<p>(Photo via Per Gosche, CC licensed.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rails\u662f\u65b0\u624b\u5165\u9580\u5b78\u5beb\u7db2\u7ad9\u6700\u8f9b\u82e6\u7684\u9078\u64c7\u4e4b\u4e00\u3002 \u5e38\u5e38\u6709\u6587\u7ae0\u6216\u662f\u8ab2\u7a0b\u5efa\u8b70\u65b0\u624b\u7528Rails\u5165\u9580\u5beb\u7db2\u7ad9\uff0c\u6211\u8a8d\u70ba\u9019\u7a2e\u5efa &hellip; <a href=\"https:\/\/blog.turn.tw\/?p=2881\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">\u7d66\u7db2\u7ad9\u521d\u5b78\u8005\u7684\u5efa\u8b70\uff1a\u7528 Ruby on Rails \u975e\u5e38\u8f9b\u82e6\uff0c\u7528 PHP \u975e\u5e38\u8212\u670d<\/span> <span class=\"meta-nav\">&rarr;<\/span> <\/a><\/p>\n","protected":false},"author":1,"featured_media":2903,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts\/2881"}],"collection":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2881"}],"version-history":[{"count":54,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts\/2881\/revisions"}],"predecessor-version":[{"id":2940,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts\/2881\/revisions\/2940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/media\/2903"}],"wp:attachment":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}