rummelonp.comNameKazuya Takeshima Blogrummelonp.hatenablog.com Mastodon@[email protected] Twitter@rummelonp GitHub@rummelonp
HeartRails Tech Blog ãã¼ãã¬ã¤ã«ãºã®ã¨ã³ã¸ãã¢ããã¶ã¤ãã¼ã«ããããã°ã§ãã ã¦ã§ããµã¼ãã¹ãã¹ããã¢ããªãIoT ããã¤ã¹ã®éçºã«é¢é£ããæè¡çãªæ å ±ãçºä¿¡ãã¦ããã¾ãã ããã«ã¡ã¯ããã¼ãã¬ã¤ã«ãºã®å島(@netwillnet)ã§ããä»å㯠aasm ã¨ãããç¶æ é·ç§»ãã¹ãã¼ãã«ç®¡çããããã®Railsãã©ã°ã¤ã³ã®ç´¹ä»ããããã¨æãã¾ãã ã¤ã³ã¹ãã¼ã«æ¹æ³ gem install aasm ã ãã ã©ãããã¨ãã«ä½¿ããã®ï¼ è¤æ°ã®ç¶æ ãæã¤ã¢ãã«ã管çããã¨ãã«å¨åãçºæ®ãã¾ããä¾ã¨ãã¦ãææãã¦ããæ¬ã®ç¶æ ã管çããã¢ãã«ãæ¸ãã¦ã¿ã¾ããããç¶æ ã«ã¯ æªèª(not_read) èªãã§ãéä¸(reading) æ¢èª(read) æ¨ã¦ã(dump) ã®ï¼ã¤ãããã¨ãã status ã«ã©ã ã§ç®¡çãã¾ããã¾ããå¥ã®ç¶æ ã¨ãã¦ãåéã«è²¸ãã¦ãããã管çãã lendin
Ruby ã¨ã®ä»ãåãã¯ãããªãã«é·ãã®ã§ããå®ã¯ Rails ã§ä½ããä½ã£ããã¨ã¯ä¸åº¦ãããã¾ããã1scaffold ã migration ã¯ä¸éã試ãã¦ã¿ããã¨ããã£ãããã©ããä½ãæããªãä¸å®æãç¸ã®ãªãããä»ã¾ã§ã¯å¨è¾ºæè¡ã®ä¸ã¤ã¨ãã¦ä»¥ä¸ã«ã¯è§¦ã£ããã¨ãããã¾ããã§ããã èå³ä»åãåºé ãã¯ããããã©ã å ¨é¢çã« Merb & Rack ãã¼ã¹Arel ç»å ´i18n ã®æ©æ§ãçµã¿è¾¼ã¿æ¸ã¿ãã§ã«å®ç¸¾ãå¢ãã¦ãã¦ãã辺ãã§å¼·ãèå³ã湧ãã¦ããã®ã§ã¾ãã¯ä¸éãã®æºåããã¦ã¿ã¾ããã æ¶æ¥µçãªçç±æ¶æ¥µçãªçç±ãå®ã¯ãã£ã¦ããã㯠PHP ã®ã¬ã¬ã·ã¼ã³ã¼ãã¨æ¦ãã®ã«ç²ããè² åµã®ãã PHP ã§ææ°ãã¼ã¸ã§ã³ã«è¿½ãã¤ãã®ã¯å¤§å¤ææ°ãã¼ã¸ã§ã³ã§ãªã㨠PHP ã PHP ã®ãã¬ã¼ã ã¯ã¼ã¯ã®æ¨å³ã¯å³ãããªãRuby ãªãææ°ã§ãªããã£ã¦éã¹ãRails ã®éå»ã®ä½æ³ãã»ã¨ãã©ç¥ããªãã®ã§æ··ä¹±ã
ããã«ã¡ã¯ã@sawada0903ãã¨æ¾¤ç°ã§ãã ä»Rails3.0ã使ã£ã¦ãµã¼ãã¹ãéçºãã¦ããã®ã§ããã DBãå®ç¾©ããã«ãããããã¯ãERå³ã欲ããã Rails2.3.8ã使ã£ã¦ããé ã¯Railroadã¨ããgemã使ã£ã¦ããã ã§ããã2008å¹´ã§éçºãæ¢ã¾ã£ã¦ãããå½ç¶Rails3.0ã«ã¯é対å¿(æ¶)ã ã¡ãªã¿ã«Railroadã«é¢ãã¦ã¯ãã®è¨äºã詳ããã§ããè¥å¹²ããè¥å¹²ã Railsãè¦ããåãRailRoadã http://www.moongift.jp/2007/07/railroad/ ãªã®ã§ãã°ããé ã®ä¸ã§éçºãé²ãã¦ãããã§ããã©ããã£ã±ã欲ããã ã¢ã¸ã£ã¤ã«æ°å³ã«éçºãã¦ãã®ãããããã£ã¤ãæåãã決ããããªãã ã¨ã¯ãããªã¬ã¼ã·ã§ã³ãç®ã§è¦ããããè¤æ°äººã§éçºããã¨ãªãã¨å°æ´æ¬²ããã ããã§ãGoogleããã«èãã¦ã¿ã....ã ã¨ï¼ ãããªgemãçºè¦ã
Django for a Rails Developer by Ashok on November 26, 2009 This is not yet another Django vs Rails blog post. It is a compilation of notes I made working with Django after having worked on Rails for years. In this post I want to give a brief introduction to Django project layout from a Rails developer point of view, on what is there, what is not there and where to look for things. It should help a
æè¿ãRailsãã¬ã·ã¬ã·ä½¿ã£ã¦ã¿ã¦ãå¿æ ¹çã«ã¯ããã¾ã好ãã«ãªããªããªãã¨æããããã§ããï¼â»ç´ ç´ã«ãªããªãã®ã§ã¯ãªããæ®éã«ããæãï¼ãããã§ãã¡ãªãããããã¤ãæããã®ã§åæãã¦ã¿ã¾ããã â»ãã¾ããµã¼ããµã¤ãã®å¦çã¯æ å½ãã¦ãã¾ãããã©ã¡ããã¨ããã¨ãè£å´ã®å¦çãæ¸ãã¦ã¾ãããããããä»äºããã¦ãã人éã®ææãªã®ã§ãã¡ã¨çéã¨ã¯ãºã¬ãããããã requireã£ã¦æ¸ããªãã¦ãã ã¸ãã¸ããç¡ç²¾è ã§ããã ããã©ã«ãã§ããããªãã®ãã¤ã³ã¯ã«ã¼ãããã¦ãã¦ãèªåã§æ¨æºã¢ã¸ã¥ã¼ã«ãå¼ã¶ãã¨ãå°ãªãã¨ããã®ã¯ã楽ã§è¯ãã¨æãã¾ãã æ¥ä»ã»æå»ã®æ±ããç°¡æ å ã Rubyã¯Date.parseã£ã¦æ¸ãã°ãå²ã¨ç©ºæ°ãèªãã§ããããããããã«ãæ¥ä»å¦çã¯ããªãç°¡æã§ãããActiveSupportã¯ããã«è¼ªãããã¦ä¾¿å©ã§ãã tomorrowã¨è¨ãã°ç¿æ¥ãåºã¦ããããnext_weekã¨è¨ãã°æ¬¡é±
åèï¼http://d.hatena.ne.jp/mizzusano/20080407/1207531215webdesigningã¨ãèªãã§ãã¨AIRã¨ãFlexã®ãã¿ãããã¨ç®ç«ã¤ãDBPressã¨ãèªãã§ãã¦ããAIRã¨ãFlexã®è¨äºã¯å²ã¨ããï¼AS3ï¼å«ãã¦ãã§ãèãã¦ã¿ãã®ã ãã©ããããããFlexã¯èª°ã®ããã«ããã®ããã¨ãããã¨ãããããFlexã¨ã¯ãªããªã®ãã¨ãããã¯æªã ã«åãããããããªãã®ã ãã©ãæ©ã話ãHTMLãªã®ã§ã¯ãªããã¨ãHTMLã®ä»£ããã«MXMLããã£ã¦ãJavascriptã®ä»£ããã«ActionScriptã使ããã®ã§ã¯ãªãããªã¨ãã§ãFlexã¨ãããã®ã¯ãRIAãæ軽ã«ãµã¯ã£ã¨ä½ãäºãã§ãããã¼ã«ã§ãããããDreamWeaverã©ã¤ã¯ã«ããã©ãã·ã¥ãã«ãªãµã¤ããæ§ç¯ã§ããããã©ãã°ã¢ã³ãããããã§ãªãã¸ã§ã¯ããé ç½®ãã¦ããã ãã§ããµã¤ããä½ããã®ã ããã
é¡ã«è¦ããï¼æè¿ãéæ°´å£ããæ°ã«ãªãã¨ãã話 ãéæ°´å£ããæ°ã«ãªãä»æ¥ãã®é æè¿è¡ä¸ã§æ°ã«ãªãåå¨ãããããã®ãéæ°´å£ãã§ããå°ä¸ã®ããã¢ã7é以ä¸ãããã«ãªã©ãä¸å®ã®æ¡ä»¶ãæºããã建ç¯ç©ã«ã¯è¨ç½®ã義åä»ãããã¦ãããã®ã§ãç«äºãçºçããããã¢ã«ãã ã¡ã«æ°´ãéãããã«ä½¿ããããã®ã§ãããã³ãè»â¦
Rails 2.2ããå°å ¥ãããI18nã¢ã¸ã¥ã¼ã«ã ãããããã«ãã¼ã¸ã§ã³0.0.1ã ããã£ã¦ãå®éã«æ¥æ¬èªã§ã¢ããªãä½ã£ã¦ã¿ãã¨ç´°ããã¨ããã§ã¡ãã£ã¨ãã¤ã¤ã±ã¦ãªãã£ããããã¨ãããç®ã«ã¤ãã 以ä¸ã«ãåãä»ã¾ã§ã«æ°ã«ãªã£ãã¨ãããæãã¦ã¿ããã 1. ARã®error_messages_forã§ã«ã©ã åã¨ã¡ãã»ã¼ã¸ã®éã«åè§ã¹ãã¼ã¹ãå ¥ã active_record-2.2.2/lib/active_record/validations.rb 208è¡ç®ããæç² 1 full_messages << attr_name + ' ' + message åè§ã¹ãã¼ã¹ãã¼ãã³ã¼ãï¼ï¼ ãã®ãããã§ãä¾ãã°ããååãã«ã©ã ã®å¿ é ãã§ãã¯ã®ã¡ãã»ã¼ã¸ã ãåå ãå ¥åãã¦ãã ãããã ã¨ããããã«è¡¨ç¤ºããã¦ãã¾ããåè§ã¹ãã¼ã¹ããã¡ããã¡ãæ°ã«ãªãã¾ãããã ããã§ããããªãã±ãããããã¦è¶ ã
emacsã§Railséçºãããéãemacs-railsã使ã£ã¦ããæ¹ãå¤ãã¨æãã¾ããemacs-railsã¯ã¨ã¦ã便å©ãªelispãªã®ã§ãããæè¿ã¯æ´æ°é »åº¦ãä½ããrhtmlâhtml.erbã®å¯¾å¿ãä¸é¨ããã¦ããªãã£ãããã¾ãããã¨Rspecã®å¯¾å¿ãã¤ãã¤ããemacs使ãã®äººãã¡ã¯ä¸ä½ã©ããã£ã¦Railséçºãã¦ããã®ã§ããããï¼ ããã§Rinariã§ãã Rails On Emacs | Google ã°ã«ã¼ããè¦ãã¨æè¿ã¯"Rinari"ã®è©±é¡ã§æã¡åããªããã§ããRinariã¯emacs-railsã¨ã¯éãã³ã¢é¨åãå°ããä¿ã£ã¦ããã©ã°ã¤ã³ã§æ¡å¼µãã¦ããã¿ã¤ãã®elispã§ãã Rinari: Ruby on Rails Minor Mode for Emacs åºæ¬çã«ã¯ä¸è¨ã«å ¨é¨æ¸ãã¦ããã®ã§ãããæ´çããæå³ã§ã¾ã¨ãã¦ã¿ã¾ãã ã³ã¢é¨åã®ã¤ã³ã¹ãã¼ã« ã¾ããgitã§ã
以åããªãªã¸ãã«ã®scaffoldã¸ã§ãã¬ã¼ã¿ã¼ãä½ãã®ãã³ã£ããããã»ã©ç°¡åãªãã¨ãç¥ã£ã¦ã次ã®ããã¸ã§ã¯ããå§ããæã«ã¯å¿ ãããç¨ã®scaffoldãä½ã£ã¦ããå§ãããã¨æã£ã¦ã¾ããã ãã©ã°ã¤ã³ã®éå½¢ãä½ããååã¯é©å½ã§ããï¼YetAnotherScaffoldï¼ script/generate plugin ya_scaffold ããã©ã«ãã®scaffoldãã³ãããï¼ä¸è¨ã®å ´æã¯Debianã®å ´åï¼ mkdir -p vendor/plugins/ya_scaffold/generators cp -r /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails_generator/generators/components/scaffold \ vendor/plugins/ya_scaffold/generators/ya_scaff
rails ã®2.x ç³»ãã¾ã¨ãã«åå¼·ãã¦ããªãã£ãã®ã§ã調æ»ãã¾ãããã³ããã®é¨åãå¤ãã§ãããæ å ±ã½ã¼ã¹ã¨å ±ã«è¨è¿°ãã¾ãã ãã¾ãå¤æ´ç¹ããªãã£ããã¤ãã¼ã¢ãããã¼ãã¯é¤å¤ãã¦ããã¾ãã 1.2.4 2.0 ããã¨ã©ã¼ã«ãªãæ§æã«å¯¾ããè¦ååºå 1.2.4 ã§è¦åãã§ãªããã°ã2.0 ã§åé¡ãªãåãã¨è¨ããã¦ãã ã»ãã·ã§ã³åºå®æ»æ対çã¨ãã¦, URLãã¼ã¹ã»ãã·ã§ã³ã®ãµãã¼ããåé¤ ActiveRecord::Base#to_jsonã使ã£ã¦ããå ´åã«çºçããå¯è½æ§ãããXSSæ»æãåé¿ããããã«JSONã¨ã³ã³ã¼ãã£ã³ã°ã¢ã«ã´ãªãºã ãå¤æ´ åè Rails 1.2.4ç»å ´ - 2.0ã§ã®å¯¾å¿äºå®è ãæ¬ãã¼ã¸ã§ã³ã§è¦åãã§ãã¯ã | ã¨ã³ã¿ã¼ãã©ã¤ãº | ãã¤ã³ãã¸ã£ã¼ãã« 1.2.5 JSONXSS ä¿®æ£ åè Ruby on Rails 1.2.5å ¬é - JSON XSSèå¼±æ§ã
The performance of Ruby on Rails is influenced by many factors, particularly the configuration of your deployment server(s). However the application code can make a big difference and determine whether your site is slow or highly responsive. This short article is about some of the tips and best coding practices to improve performances in Rails only, and wonât attempt to cover the server configurat
æªãåè«ã¨ããæããªããã ãã©ãMerb 㨠Rails ãçµ±åããããããã Merb gets merged into Rails 3! by DHH (Rails ä½è ) Rails And Merb Merge by Yehuda Katz (Merb 主任éçºè ) Rails and Merb core team working together on their next release by Matt Aimonetti (Merb ã³ã¢ãã¼ã ã¡ã³ãã¼ & merb-book ãªã¼ãã¼) Merb *is* Rails by Ezra Zygmuntowicz (Merb project åµå§è & EngineYard å ±åè¨ç«è ) Rails and Merb Bury the Hatchet (Rails ã®æåããã°) å®ã¯ 1 é±éåã«ãDHH ã Merb ã®ä¿¡è
ãã¼ã«ã«éçºç°å¢ãpassengerã§ã # /etc/apache2/sites-available/cloister <VirtualHost *:80> ServerName cloister DocumentRoot /var/www/cloister CustomLog /var/log/apache2/cloister-access.log combined ErrorLog /var/log/apache2/cloister-error.log RailsEnv development RailsBaseURI / </VirtualHost> <VirtualHost *:443> ServerName cloister DocumentRoot /var/www/cloister CustomLog /var/log/apache2/cloister-ssl-access
â [Rails] Metal Rails edge ã« Metal ã¨ããæ°ããæ©è½ã追å ãããããã㯠Rack ãç¨ããé«é㪠Controller ã§ãããRails ã®è²ããªæ©è½ã¯æ¨ã¦ã¦ã§ããå ã«è§ãåç´ã§éãã¬ã¹ãã³ã¹ãã©ããã¦ãå¿ è¦ã ï¼ã¨ããå±é¢ã§ã¯ãã®åãå©ãã«ãªãã ããã http://github.com/rails/rails/commit/8c3a54366435eebc2c8aa63b63e1349ce74a7b38 ä½æ å ´æ㯠app/metalãmetal ã¸ã§ãã¬ã¼ã¿ãç¨æããã¦ããã®ã§ãcontroller ã¨åãæè¦ã§ä½¿ãããæ¢åã®ã³ã³ããã¼ã©(top1)ã¨é度æ¯è¼ãããã®ã§ããã¡ãã®ååã¯top2ã«ãã¦ã¿ãã å¾æ¥ã®ã³ã³ããã¼ã©çææ³ã§ããã° top2_metal.rb ãä½æãããããªãã®ã ããããã¯ãªã£ã¦ããªãããã®è¾ºãããã« Merb èãå°ã
ã¯ã¦ãªã°ã«ã¼ãã®çµäºæ¥ã2020å¹´1æ31æ¥(é)ã«æ±ºå®ãã¾ãã 以ä¸ã®ã¨ã³ããªã®éããä»å¹´æ«ãç®å¦ã«ã¯ã¦ãªã°ã«ã¼ããçµäºäºå®ã§ããæ¨ããç¥ãããã¦ããã¾ããã 2019å¹´æ«ãç®å¦ã«ãã¯ã¦ãªã°ã«ã¼ãã®æä¾ãçµäºããäºå®ã§ã - ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãã®ãã³ãæ£å¼ã«çµäºæ¥ã決å®ãããã¾ããã®ã§ã以ä¸ã®éãã確èªãã ããã çµäºæ¥: 2020å¹´1æ31æ¥(é) ã¨ã¯ã¹ãã¼ãå¸æç³è«æé:2020å¹´1æ31æ¥(é) çµäºæ¥ä»¥éã¯ãã¯ã¦ãªã°ã«ã¼ãã®é²è¦§ããã³æ稿ã¯è¡ãã¾ãããæ¥è¨ã®ã¨ã¯ã¹ãã¼ããå¿ è¦ãªæ¹ã¯ä»¥ä¸ã®è¨äºã«ãããã£ã¦æç¶ãããã¦ãã ããã ã¯ã¦ãªã°ã«ã¼ãã«æ稿ãããæ¥è¨ãã¼ã¿ã®ã¨ã¯ã¹ãã¼ãã«ã¤ã㦠- ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãå©ç¨ã®ã¿ãªãã¾ã«ã¯ãè¿·æãããããããã¾ãããã©ãããããããé¡ããããã¾ãã 2020-06-25 è¿½è¨ ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ã®ã¨ã¯ã¹ãã¼ããã¼ã¿ã¯2020å¹´2æ28
ä»å㯠ETag(Entity Tag) ã®è©±é¡ã§ãããµã¼ãã®æ§æãããããã¨èãã¦ãã¦æ°ã«ãªãå§ããæè¡ã®ä¸ã¤ã§ãã ETag ã®è©³ç´°ãªèª¬æã¯çãã¾ãããHTTP/1.1 ã§å®ç¾©ããã¦ãããããã§ããã£ãã·ã¥ã³ã³ããã¼ã«ã«ä½¿ããã¾ãã Apache ã®å®è£ ã§ã¯ããã©ã«ã㧠ETag ã¯ãã¡ã¤ã«ãµã¤ãºãæçµæ´æ°æ¥æãinode çªå·ã®3ã¤ããè¨ç®ãããã®ã§ããããããåæ£ç°å¢ã§ã¯ãã£ãã·ã¥ã®å¹ããªãåå ã«ãªãã¾ããï¼åãå 容ãã¡ã¤ã«ã§ãå¥ã®ãµã¼ãä¸ã«ããå ´åã«ã¯ inode çªå·ãåãã«ãªããã¨ã¯ã»ã¼ããå¾ãªããããè² è·åæ£ã®é½åã§å¥ãµã¼ãã«å²ãå½ã¦ãããå ´åãETagãå¤ãã£ã¦ãã¾ããï¼ãµã¼ãã®åæ£ãããã«å½ãã£ã¦ã©ããªåé¡ããããã調ã¹ã¦ãã¦ã¿ã¤ãã¾ããããããåé¿ããããã«ã¯ãApache 2.0 以éã§ã¯ FileETag ãã£ã¬ã¯ãã£ãã®è¨å®ã§ ETag ã« inode çªå·ãå«
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}