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

20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 Phpstudy
Yusuke Ando
 
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
Atsuhiro 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 Version
Libin Pan
 
Rubykaigi2008: REST 信者から見た Ruby と Rails
Rubykaigi2008: REST 信者から見た Ruby と RailsRubykaigi2008: REST 信者から見た Ruby と Rails
Rubykaigi2008: REST 信者から見た Ruby と Rails
Yohei Yamamoto
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909
Yusuke Wada
 

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

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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...
 

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 とか表示してみるのもいいかも ● ただしインストールに難あり