SlideShare a Scribd company logo
1 of 20
Download to read offline
rails-footnotes の紹介




       小川 伸一郎
(Rust/OGAWA, conceal-rs)
自己紹介
●
    小川 伸一郎
●
    Rust/OGAWA, id:conceal-rs
●
    Rails で携帯向け ML サービス構築
      –   裏側担当
●
    Ruby/Rails 歴 1 年ちょい
●
    京都生まれの大阪育ち
rails-footnotes とは
●
    簡単に言うとブラウザでデバッグできる
      –   あぁ,このときの request.env 見たいけど・・・・
             ●
                 logger.debug request.env
      –   いまこのページの Query は・・・・
             ●
                 tail -f log/development.log
      –   session に設定されてるはずなんだけどなぁ・・・・
             ●
                 pp session
    というのを解決してくれるプラグイン
●
    インストールするだけで動く
●
    デフォルトで development 環境のみ表示される
インストール
●
    Rails 2.2.2
    % git clone git://github.com/drnic/rails-footnotes.git
    vendor/plugins/footnotes
    % rm -rf vendor/plugins/footnotes/.git
Rails2.1.x でのインストール
●
    Rails 2.2.x 以外では README 通りでインストール
     できない
                                                 % cd vendor/plugins/footnotes
                                                 % git checkout v3.2.2
                                                 Note: moving to quot;v3.2.2quot; which
                                                 isn't a local branch
                                                 …
                                                 % git branch
                                                 * master
                                                 %


●
    なので Download して展開
    % wget http://github.com/drnic/rails-footnotes/tarball/v3.2.2
    % tar zxvf drnic-rails-footnotes-SHA1HASH.tar.gz
    % mv drnic-rails-footnotes-SHA1HASH /path/to/app/vendor/plugins/footnotes
rails-footnotes をインストールすると
サンプルとして
%   rails footnotes; cd footnotes
%   ruby script/generate scaffold Post title:string name:string body:string
%   rake db:migrate
%   git clone git://github.com/drnic/rails-footnotes.git vendor/plugins/footnotes
%   rm -rf vendor/plugins/footnotes/.git
%   ruby script/server
rails-footnotes の特徴 (1/9)
●
    セッション
rails-footnotes の特徴 (2/9)
●
    Cookie
rails-footnotes の特徴 (3/9)
●
    request.params
rails-footnotes の特徴 (4/9)
●
    before_filter/after_filter/etc.
rails-footnotes の特徴 (5/9)
●
    routing
rails-footnotes の特徴 (6/9)
●
    request.env
rails-footnotes の特徴 (7/9)
●
    Queries
rails-footnotes の特徴 (7/9)
●
    Queries
       –   explain
       –   trace
rails-footnotes の特徴 (7/9)
●
    Queries
       –   explain   EXLAIN SELECT ....
       –   trace     どこの何行目か
rails-footnotes の特徴 (8/9)
●
    development.log
rails-footnotes の特徴 (9/9)
●
    お手軽に自分で拡張可能
     –   たとえば @post の内容を表示したいとき
         module Footnotes
           module Notes
             class PostNote < AbstractNote
               def initialize(controller)
                 @post = controller.instance_variable_get(quot;@postquot;)
               end

              def legend
                quot;Post title: #{@post.title}quot;
              end

              def valid?
                @post
              end

               def content
                 escape(@post.inspect)
               end
             end
           end
         end
rails-footnotes の特徴 (9/9)
●
    お手軽に自分で拡張可能
     –   たとえば @post の内容を表示したいとき
まとめ
●
    Rails アプリを開発するなら必須プラグイン
●
    ブラウザにデバッグ情報表示できる
      –   Terminal いぱいに tail とかしなくていい
●
    EXPLAIN を見て MySQL に優しい開発
      –   EXPLAIN で適切なインデックス計画
●
    自分で拡張して情報表示
      –   @current_user とか表示してみるのもいいかも

●
    ただしインストールに難あり

More Related Content

Similar to rails-footnotes

オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 RubyKitajiro Kitayama
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 PhpstudyYusuke Ando
 
Ruby on Rails Tutorial Part I
Ruby on Rails Tutorial Part IRuby on Rails Tutorial Part I
Ruby on Rails Tutorial Part IWei Jen Lu
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginXStoyan Zhekov
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPAtsuhiro Kubo
 
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionRuby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionLibin Pan
 
Rubykaigi2008: REST 信者から見た Ruby と Rails
Rubykaigi2008: REST 信者から見た Ruby と RailsRubykaigi2008: REST 信者から見た Ruby と Rails
Rubykaigi2008: REST 信者から見た Ruby と RailsYohei Yamamoto
 
Rails Cache
Rails CacheRails Cache
Rails Cachewear
 
Ruby off Rails (japanese)
Ruby off Rails (japanese)Ruby off Rails (japanese)
Ruby off Rails (japanese)Stoyan Zhekov
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909Yusuke Wada
 
Swap Skills I Phone
Swap Skills I PhoneSwap Skills I Phone
Swap Skills I PhoneSwapSkills
 
Working With Rails
Working With RailsWorking With Rails
Working With RailsDali Wang
 
Spring基础教程
Spring基础教程Spring基础教程
Spring基础教程Shilong Sang
 

Similar to rails-footnotes (20)

オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Ruby
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 Phpstudy
 
Ruby on Rails Tutorial Part I
Ruby on Rails Tutorial Part IRuby on Rails Tutorial Part I
Ruby on Rails Tutorial Part I
 
XS Japan 2008 Xen Mgmt Japanese
XS Japan 2008 Xen Mgmt JapaneseXS Japan 2008 Xen Mgmt Japanese
XS Japan 2008 Xen Mgmt Japanese
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginX
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 
Spring Framework勉強会
Spring  Framework勉強会Spring  Framework勉強会
Spring Framework勉強会
 
Revisited
RevisitedRevisited
Revisited
 
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionRuby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
 
Rubykaigi2008: REST 信者から見た Ruby と Rails
Rubykaigi2008: REST 信者から見た Ruby と RailsRubykaigi2008: REST 信者から見た Ruby と Rails
Rubykaigi2008: REST 信者から見た Ruby と Rails
 
Rails Cache
Rails CacheRails Cache
Rails Cache
 
Apache Tapestry
Apache TapestryApache Tapestry
Apache Tapestry
 
Ruby off Rails (japanese)
Ruby off Rails (japanese)Ruby off Rails (japanese)
Ruby off Rails (japanese)
 
Grails紹介
Grails紹介Grails紹介
Grails紹介
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909
 
Swap Skills I Phone
Swap Skills I PhoneSwap Skills I Phone
Swap Skills I Phone
 
Working With Rails
Working With RailsWorking With Rails
Working With Rails
 
spring_jiaocheng
spring_jiaochengspring_jiaocheng
spring_jiaocheng
 
Spring基础教程
Spring基础教程Spring基础教程
Spring基础教程
 

Recently uploaded

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

rails-footnotes

  • 1. rails-footnotes の紹介 小川 伸一郎 (Rust/OGAWA, conceal-rs)
  • 2. 自己紹介 ● 小川 伸一郎 ● Rust/OGAWA, id:conceal-rs ● Rails で携帯向け ML サービス構築 – 裏側担当 ● Ruby/Rails 歴 1 年ちょい ● 京都生まれの大阪育ち
  • 3. rails-footnotes とは ● 簡単に言うとブラウザでデバッグできる – あぁ,このときの request.env 見たいけど・・・・ ● logger.debug request.env – いまこのページの Query は・・・・ ● tail -f log/development.log – session に設定されてるはずなんだけどなぁ・・・・ ● pp session というのを解決してくれるプラグイン ● インストールするだけで動く ● デフォルトで development 環境のみ表示される
  • 4. インストール ● Rails 2.2.2 % git clone git://github.com/drnic/rails-footnotes.git vendor/plugins/footnotes % rm -rf vendor/plugins/footnotes/.git
  • 5. Rails2.1.x でのインストール ● Rails 2.2.x 以外では README 通りでインストール できない % cd vendor/plugins/footnotes % git checkout v3.2.2 Note: moving to quot;v3.2.2quot; which isn't a local branch … % git branch * master % ● なので Download して展開 % wget http://github.com/drnic/rails-footnotes/tarball/v3.2.2 % tar zxvf drnic-rails-footnotes-SHA1HASH.tar.gz % mv drnic-rails-footnotes-SHA1HASH /path/to/app/vendor/plugins/footnotes
  • 7. サンプルとして % rails footnotes; cd footnotes % ruby script/generate scaffold Post title:string name:string body:string % rake db:migrate % git clone git://github.com/drnic/rails-footnotes.git vendor/plugins/footnotes % rm -rf vendor/plugins/footnotes/.git % ruby script/server
  • 11. rails-footnotes の特徴 (4/9) ● before_filter/after_filter/etc.
  • 15. rails-footnotes の特徴 (7/9) ● Queries – explain – trace
  • 16. rails-footnotes の特徴 (7/9) ● Queries – explain EXLAIN SELECT .... – trace どこの何行目か
  • 18. rails-footnotes の特徴 (9/9) ● お手軽に自分で拡張可能 – たとえば @post の内容を表示したいとき module Footnotes module Notes class PostNote < AbstractNote def initialize(controller) @post = controller.instance_variable_get(quot;@postquot;) end def legend quot;Post title: #{@post.title}quot; end def valid? @post end def content escape(@post.inspect) end end end end
  • 19. rails-footnotes の特徴 (9/9) ● お手軽に自分で拡張可能 – たとえば @post の内容を表示したいとき
  • 20. まとめ ● Rails アプリを開発するなら必須プラグイン ● ブラウザにデバッグ情報表示できる – Terminal いぱいに tail とかしなくていい ● EXPLAIN を見て MySQL に優しい開発 – EXPLAIN で適切なインデックス計画 ● 自分で拡張して情報表示 – @current_user とか表示してみるのもいいかも ● ただしインストールに難あり