{"id":1711,"date":"2008-03-17T11:49:49","date_gmt":"2008-03-17T03:49:49","guid":{"rendered":"http:\/\/ihower.idv.tw\/blog\/archives\/1711"},"modified":"2015-09-05T10:54:30","modified_gmt":"2015-09-05T02:54:30","slug":"textmate-on-rails-2","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/1711-textmate-on-rails-2","title":{"rendered":"Textmate on Rails 2"},"content":{"rendered":"<p>Rails on Rails \u5df2\u7d93\u51fa\u5230 2.0 \u4e86\uff0c\u4e0d\u904e Textmate \u5167\u5efa\u7684 Bundle \u9084\u662f 1.x\uff0c\u9700\u8981\u66f4\u65b0\u3002\u8acb\u4e0b\u8f09 <a href=\"http:\/\/github.com\/drnic\/ruby-on-rails-tmbundle\/tree\/master\">Textmate bundle<\/a>\uff0c\u6700\u597d\u7684\u65b9\u5f0f\u662f\u7528 git\uff0c\u4e0d\u904e\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f09\u653e\u5230 [~\/Library\/Application Support\/TextMate\/Bundles] \u4e0b\uff0c\u4e26\u547d\u540d\u70ba Ruby on Rails.tmbundle\uff0c\u7136\u5f8c\u5728 textmate \u88e1 reload bundle \u5373\u53ef\u3002<\/p>\n<p>\u53e6\u5916\u4e5f\u8acb\u5728  [\/Applications\/TextMate.app\/Contents\/SharedSupport\/Support\/lib] \u57f7\u884c mv Builder.rb Builder.rb.off (\u4e0d\u7136\u67d0\u4e9b\u7528\u5230 rake \u7684 bundle \u6703\u6709\u932f\u8aa4)\u3002<\/p>\n<p>\u4f86\u80cc\u6307\u4ee4\u5427\uff5e\u5217\u4e86\u5e7e\u500b\u81ea\u5df1\u60f3\u8981\u8a18\u4e0b\u4f86\u7528\u7684\u3002<\/p>\n<p>Ctrl+command + T : \u67e5\u8a62 bundle \u6307\u4ee4<\/p>\n<p><!--more--><\/p>\n<p>Shift+Ctrl+| : \u57f7\u884c Rails script \u6307\u4ee4( generate\/plugin\/migrate \u7b49\u7b49)<\/p>\n<h3>Migration<\/h3>\n<p>mcol<br \/>\nmtab<br \/>\nt. : \u8cbc\u4e0a sexy migration<\/p>\n<h3>Model<\/h3>\n<p>hm<br \/>\nhmt<br \/>\nho<br \/>\nbt<br \/>\nvp<\/p>\n<p>Ctrl+Shift+Command+S \u6e38\u6a19\u5728\u67d0\u500b Model Class \u4e0a\uff0c\u53ef\u4ee5\u67e5\u770b Table schema\u3002<\/p>\n<h3>Controller<\/h3>\n<p>Ctrl+P : \u8cbc\u4e0a params[:id]<br \/>\nrest : \u8cbc\u4e0a respond_to block<br \/>\nShift+option+command+ \u4e0b : \u5c0e\u89bd\u529f\u80fd( Mode<->Controller<->View )<\/p>\n<h3>Route<\/h3>\n<p>mapr : \u8cbc\u4e0a map.resource<br \/>\nmaprs : \u8cbc\u4e0a map.resources<br \/>\nmapwo : \u8cbc\u4e0a map.with_options<\/p>\n<h3>Views<\/h3>\n<p>ft : form_tag<br \/>\nff : form_for<br \/>\nffe : error_messages_for<br \/>\nf. : \u53ef\u9078\u8cbc\u4e0a\u54ea\u7a2e\u8868\u55ae\u6b04\u4f4d<br \/>\nrp : render partial<br \/>\nrpl : render partial with locals<br \/>\nlip : link_to path<br \/>\nlim : link_to model<br \/>\nend<br \/>\nShift+Ctrl+ > : \u8cbc\u4e0a erb \u5340\u584a<br \/>\nShift+Ctrl+ &lt; : \u8cbc\u4e0a html \u5340\u584a<br \/>\nShift+Ctrl+command+W : \u628a\u4e00\u6574\u584a\u6bcf\u884c\u524d\u5f8c\u52a0\u4e0a html tag<br \/>\nShift+Ctrl+ H : \u628a\u4e00\u6574\u6bb5\u62c6\u6210 partial \u6a94\u6848<\/p>\n<p>\u5176\u4ed6\u6307\u4ee4\u53ef\u4ee5\u53c3\u8003\u6211\u4e4b\u524d\u5beb\u7684 <a href=\"\/blog\/archives\/1676\">Textmate tip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rails on Rails \u5df2\u7d93\u51fa\u5230 2.0 \u4e86\uff0c\u4e0d\u904e Textmate \u5167\u5efa\u7684 Bundle \u9084\u662f 1.x &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/1711-textmate-on-rails-2\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Textmate on Rails 2\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[46,53],"tags":[],"class_list":["post-1711","post","type-post","status-publish","format-standard","hentry","category-mac","category-rails","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-rB","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/comments?post=1711"}],"version-history":[{"count":1,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1711\/revisions"}],"predecessor-version":[{"id":8317,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1711\/revisions\/8317"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=1711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=1711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=1711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}