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

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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your QueriesExploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your QueriesSanjay Willie
 

Recently uploaded (20)

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...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
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...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your QueriesExploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
Exploring ChatGPT Prompt Hacks To Maximally Optimise Your Queries
 

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