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

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Recently uploaded (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

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