Saki
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 【第15週】パRails輪読会 \(2022\-10\-31\~ 2022\-11\-04\) ###### tags: `パRails(2回目)` - [開催概要](https://hackmd.io/rOcLR0riRqmOgEF0_Ssm0A?both) - [パRails輪読会 ノートまとめ](https://hackmd.io/5emISRvRRXapmakSiHnFJg?both) ## パRailsのサンプルコード・正誤表 - [サポートページ:パーフェクトRuby on Rails【増補改訂版】:|技術評論社](https://gihyo.jp/book/2020/978-4-297-11462-6/support) - [パRails 環境構築の手順](https://hackmd.io/y7qb2BRMT2Wd4tAtKYObcQ) ## 目次 [TOC] ------ ## 2022\-10\-31(月) ### 連絡事項や確認・相談 - 木曜は文化の日なのでお休みです〜 ### タイムキーパー - tomonariさん ### ドライバー - Hikaruさん ### 読んだところ - P.386 [8-1-2途中 サムネイルを生成する]〜 ### 次回 - P.390 [8-1-4 容量が大きいファイルをアップロードした場合にバリデーションエラーにする]〜 ### 自由に使う共有スペース ### 各自の疑問点や気づき、学んだこと - @garammasala29 - jpegとjpgは一緒 - ActiveStorageにはバリデーション用のヘルパーメソッドがないのでgemを使用する - `rbenv rehash`とは - [rbenv rehashをちゃんと理解する](https://mogulla3.tech/articles/2020-12-29-01) - `@event.image.blob`の中身 ``` <ActiveStorage::Blob id: 1, key: "843rc117y9g6a9qyom8s89wxrhrb", filename: "IMG_0904.JPG", content_type: "image/jpeg", metadata: {"identified"=>true, "analyzed"=>true}, byte_size: 4151365, checksum: "jR5X2zfSWNQMyMxzGj/aNA==", created_at: "2022-10-31 09:42:33"> ``` - @hikaru - ImageMagick、GraphicsMagick、libvipsは画像変換ツール - image_processingは画像変換ツールのラッパー - `rbenv rehash` はHomebrewでインストールしたツールを、railsのgemが読み込むディレクトリにコピーする - https://mogulla3.tech/articles/2020-12-29-01 - @fuwa - libvipsはImageMagickよりつよいらしいけれど、存在を知らなかった。。 - Active Storageにはバリデーション用のヘルパーメソッドがないのでActive Storage Validations gemを使いましょう - Saki - jpgとjpegは一緒 - ActiveStorageがよしなに必要なテーブルを作ってくれるので`blob`とかが難しかった - P.233より:ActiveStorageはバリデーションのヘルパーメソッドがない→gemを使う - libvipsはimagemagickよりも、メモリ消費量や実行速度が優れている - @maimu_x2x - ActvieStorageにはバリデーションヘルパーがない - Active Storage Validations gemを使うと良い - @tomonari - ImageProcessingは画像変換用のツールのラッパーで、ImageMagickの他にGraphicsMagickとlibvipsもサポートしている。 - GraphicsMagickにも優位性があるのかなと思いました。 ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - @maimu_x2x - エレベータピッチを出したのですが、町田さんからのフィードバックが的確で抜け漏れや整理しきれてなかったところが言語がされて、すごいな〜となっています。 - @fuwa - テストが永遠に終わらない悲しみ - 筋肉ちゃんを育てるために増量期に入ることにしました - @garammasala29 - 看護師向けのリリースブログを書きました。YouTubeで使い方動画作ったり、普段しないようなことなので疲れますね - https://note.com/garammasala29/n/nb821971fcaa1 - おおお〜!絶対読みます。おつかれさまでした:tea: - そういえばhamlでも`- byebug`でviewからデバッグできました! :chiken: - Saki - エラーの解決策が私は見当もつかなかったので、ガラムマサラさんすごいです👏`rbenv rehash`心に刻みました。 - Hikaruさんドライバーありがとうございました! - 👍 - 自作サービス&リリースブログ提出しましたが、まだ確認されていなくて卒業にはなってないのでドキドキしています〜🫀💣 - hikaru - 助けてくださってありがとうございました〜〜 - ------ ## 2022\11\-1(火) ### 連絡事項や確認・相談 ### タイムキーパー - tomonariさん ### ドライバー - Saki ### 読んだところ - P.390 [8-1-4 容量が大きいファイルをアップロードした場合にバリデーション]〜 ### 次回 ### 自由に使う共有スペース - homebrewでのインストールまとめ。実行に時間がかかるのでドライバーやってくださる方は事前にインストールしてもらえるよ良さそうです ```bash! # libvipsのインストール $ brew install vips # 検索機能まわりのインストール $ brew tap elastic/tap $ brew install elastic/tap/elasticsearch-full $ elasticsearch-plugin install analysis-kuromoji ``` ### 各自の疑問点や気づき、学んだこと - @maimu_x2x - Elassticsearchは存在は知っていたけれど、用途がちゃんとわかっていなかったため、明日以降が楽しみです! - Kuromojiは単語を分割してくれますが、Kuromojiが分割して認識される単語しかヒットしないため、前に単語が検索にかからないと問い合わせ受けたことがあります。 - hikaru - ダイレクトアップロードはAppサーバーを経由せずにクラウドストレージにファイルを保存するのでサーバーの負荷が減って良いらしい - `bin/rails g kaminari:views bootstrap4`でkaminariのいい感じのテーマが使えるらしい - エラスティックサーチは全文検索エンジン - DBやRailsとは別で動くので連携が必要 - @fuwa - Elasticsearch初めて知りました〜便利そうな予感 - ダイレクトアップロード時にはActive Storage Validationのバリデーションが不完全になるので注意 - @garammasala29 - ダイレクトアップロードはこの動画の始めと終わりを見るとつかめそうでした - https://gorails.com/episodes/direct-uploads-with-rails-active-storage - 形態素は言葉の意味の単位?(お/金)言語学のお話 - 自立語や付属語みたいですね - Kaminariが久々で`per`とか`page`とかあったなと思い出しました。一度公式ドキュメントさらっと読んでおきたい - @haruguchi - シードデータ作っといたら良いかも! :tashikani: - 文字実体参照いつも覚えようと思って頑張るけど、無理 - https://mimi.moe.in/nmp/hms/cer - 全文検索はまだプロジェクトでも触ったことないので楽しみ - @tomonari - 大きすぎる画像がアップロードされた時のためにバリデーションをつけておかないといけないというのが気を付けておかなければいけないと思いました。 - Saki - 1行でバリデーションをぱぱっと追加できて便利だなと思った - 画像は意図しない挙動のバリエーションがいっぱいあるので、自分で機能作る時は漏れがありそうなので気をつけねばと思いました ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - @maimu_x2x - 昨日基本情報技術者のテキストをチラ見したのですが、いきなり2のn乗の計算式が出てきて白目剥きました・・・ - 2進法!? - です! - @fuwa - チーム開発のissueで詰まっていたところが解決したっぽいのでよかったです〜 :medetai!: :tada: :tada: - 今日はたこ焼き食べる気まんまんだったのにたこ焼き屋さんが定休日でがっかりしました - Saki - 自作サービスでレビューが返ってくるまで数日間暇なので気が緩んでます。昨日と今日輪読会以外なにもしてない😇 レビュー1週間以内というのは、木曜に出したら水曜までにくださるってことですかね??それとも木曜...? - 鍋は作るの簡単で美味しくてあたたまって最高ですね - @garammasala29 - 寒い!今日も鍋! - hikaru - はてなブログを初めて書いてみようとしたんですけど、編集画面がまったく思い通りに動かなくて発狂しました - Office Wordを始めて使った時のことを思い出しました。 - はてなブログの編集画面苦手なのでVSCodeで書いてます〜 - VSCodeで書いてコピペしてます! - @haruguchi - 寒すぎて長袖きた - 基本情報僕も取りたい - ランニング土日はサボった - 昨日は走った :erai: ------ ## 2022\-11\-2(水) ### 連絡事項や確認・相談 ### タイムキーパー ### ドライバー ### 読んだところ ### 次回 ### 自由に使う共有スペース ### 各自の疑問点や気づき、学んだこと - - - - - - ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - - - - - - ------ ## 2022\-11\-3(木) 文化の日なのでお休みです ----- ## 2022\-11\-4(金) ### 連絡事項や確認・相談 ### タイムキーパー - Saki ### ドライバー - fuwaさん, Saki ### 読んだところ - P.397 [続いてイベント一覧に検索フォームを追加してみます〜] ### 次回 - P.400 [8-3 落穂ひろい]〜 ### 自由に使う共有スペース ### 各自の疑問点や気づき、学んだこと - hikaru - 検索機能を作れるのはとても便利ですが、どういう仕組みで動いているのかあんまりわからなかったですね... - @maimu_x2x - TurbolinksはformによるAjaxでのGETリクエストに対応していないため、JSのコードを追加して変換が必要 - haruguchiさんの解説わかりやすかったです - LEF - Elasticsearchが動くようになっていて良かったです!仕組みがよくわかっていないですが、イベントを名前で検索できるのがすごく便利そうだと思いました。 - JavaScript難しいです…… - @fuwa - 私の環境では`brew install elastic/tap/elasticsearch-full` をすると`Your Command Line Tools are too outdated.` と怒られてしまってできませんでした。。 - Elasticsearchすぐに検索機能作れて便利ですね〜 - JSやっぱり苦手。。。 - Saki - 検索機能作れた! が、コードがむずかしくいです... - デバッグの方法がとても勉強になりました🙏 - コードの読み下し - `turbolinks :load` がおこったらfunction以下の処理が実行される - `ajax:beforeSend`:ajaxを行う前に処理を実行する - @haruguchi - API読もうと思った - https://github.com/rails/rails/blob/8015c2c2cf5c8718449677570f372ceb01318a32/activemodel/lib/active_model/attributes.rb#L19 これか? - - @tomonari - elasticsearchは使えると便利ですが、gemのバージョンを合わせて動かすのが大変ですね。 - javascriptの解説参考になります! ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - Saki - ノート開いた時水曜が空白だったので、データ消えたのかと思いましたが、エラーとずっと戦ってた日だったのを思い出しました😇 - @maimu_x2x - 昨日7時に起きたのに二度寝してしまい次に起きたら10時半で絶望しました - あるある - 看護師の妹にガラムマサラさんのサービスを共有したら、看護ルーの記事をたくさん読むから便利!と返事がありました〜! :suteki: - ありがとうございます!嬉しい、作った甲斐があります! - @fuwa - ついにバイトをしようと決意しました。月曜に説明会行ってきます〜 - チーム開発で詰まっていたところを解決しましたが、なんで直ったのかわかりません。。 - あるある - アカン - .prevent は DOM 要素のデフォルトの挙動を止める directive ですよ (`event.preventDefault()`が呼ばれる)。デフォルトの挙動とは、たとえば a タグだったらページ遷移するとか、form だったら get/post のリクエストが飛ぶとか。これらは JS を書かなくても、そのタグさえ書けばそのように動作しますよね (= default の挙動)。それを prevent (妨害) するので preventDefault - ありがとうございます〜! - hikaru - はるぐちさんのJS講座わかりやすかったです!ありがとうございました! - Sakiさんドライバー&司会ありがとうございました〜 - @tomonari - hikaruさん、elasticsearchの調査ありがとうございました!おかげさまで進めてよかったです。 - @haruguchi - 今日**は**走る!~~絶対。~~:gogo!: - 10km!! - 5分です! not 10km! -----

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully