or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
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.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
【第3週】パRails輪読会 (2022-08-08~ 2022-08-12)
tags:
パRails(2回目)
パRailsのサンプルコード・正誤表
目次
2022-08-08(月)
連絡事項や確認・相談
タイムキーパー
ドライバー
読んだところ
次回
自由に使う共有スペース
各自の疑問点や気づき、学んだこと
hikaru(代読お願いします〜)
around_action
はメソッドの中で処理をアクションに戻さないといけないということらしいけど、around_action
でしか使えないメソッドができてしまうってこと?@fuwa
around_action
初めて知りました。正直使い方がいまいちわからないけれど、きっと便利な部分もあるのでしょう@Saki
@book = Book.find(params[:id])
という同じ処理を書いているset_book
メソッドに切り出すbefore_action
等を使うことで、コールバック処理=今回言うと、destroyアクションが走る前にset_bookメソッドを実行させる、ということができるbefore_action
などのことをフックと言うの知らなかったaround_action
yield
に、around_action
で登録したアクションが入るイメージ@haruguchi
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →LEF
@napple29
around_action
はアクションの前後に処理を差し込める@paru871
yield
で指定する。本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK)
@tomonari
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →@fuwa
LEF
@haruguchi
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →@napple29
@paru871
@Saki
2022-08-09(火)
連絡事項や確認・相談
タイムキーパー
ドライバー
読んだところ
次回
自由に使う共有スペース
ドライバーした時のコード載せておきます!
各自の疑問点や気づき、学んだこと
@napple29
@maimu_x2x
@garammasala29
collection
とmember
は復習- ルーティングの切り分けの話https://zenn.dev/shima_zu/articles/divide_rails_routes
rescue_from
で例外クラスを指定し、with
オプションでアクションを指定@Saki
rescue_from
skip_before_action
before_action :require_login
を書くと、アプリの全てのコントローラのアクションの実行前にrequire_login
が発動するskip_bedore_action :require_login(メソッド), only: [:new, :create](アクション指定)
@paru871
resorces
を使うと、一般的なCRUD操作全てのルーティングが定義できる。。。すごい!便利!member
やcollection
を使えば基本のアクション以外の任意のルーティングを設定することができる。resource
を使えばよい!@haruguchi
collection do ~ end
on: :collection
みたいな本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK)
@maimu_x2x
@napple29
@garammasala29
@haruguchi
蕎麦打ち流しそうめん@Saki
@paru871
2022-08-10(水)
連絡事項や確認・相談
タイムキーパー
ドライバー
読んだところ
次回
自由に使う共有スペース
各自の疑問点や気づき、学んだこと
@napple29
_
始まりLEF
locals
で明示的に渡したほうがいいよ、とレビューで教えていただいたのを思い出しました(それまでは暗黙的?に渡していました)。require
とpermit
を使って書く!@Saki
render :show
などを書かず、rails g controller
すると自動的にcontrollerと対応したviewができるので意識していなかったrender :show
でviewテンプレートを呼び出せるrender アクション名
と解釈される。なのでshowアクションで省略すると自動的にshowのviewと解釈する@haruguchi
@maimu_x2x
@fuwa
@paru871
permit
で定義しておくrender
redirect_to
などを使って表示するものを指示する:status
オプションを渡してステータスコードを指定できる本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK)
@tomonari
@maimu_x2x
@fuwa
@haruguchi
@napple29
@paru871
@Saki
- では明日、琵琶湖集合で!! 🚀
- 東京で!!!!!電車代出すんで!!!
@cafedomancer
LEF
8/10(水)の「Webpacker::Manifest::MissingEntryError in コントローラー名#アクション名」のエラー解消について
👉 エラー解消のためにやったこと
👉 nodeのバージョンを自動で切り替えられるようにするため、
.nvmrc
と.node-version
の2つのファイルを設置しました。.nvmrc
の設定ができている方は特に何もしなくてOKです。.nvmrc
の対応をお願いします。JavaScript環境の設定 | FBC
👉 BootcampアプリのWikiにもnodeの切り替えの方法の説明があります。
nodeのバージョン切り替え · fjordllc/bootcamp Wiki
👉 nodeのインストール用コマンド(nvm使用の場合)
$ nvm ls
$ nvm install 12.22.12
👉 よくわからない場合は一緒に設定をやりますので、ドライバーに指名された場合でもご安心ください😊
👉 今日お見せできなかったviewが無事に表示されましたのでご報告です!

2022-08-11(木) 祝日なのでお休み
2022-08-12(金)
タイムキーパー
ドライバー
読んだところ
次回
自由に使う共有スペース
format
の中身各自の疑問点や気づき、学んだこと
@maimu_x2x
LEF(代読お願いします🙏)
=~
メソッドで正規表現マッチングすることを忘れていたので参考になりました。pp
メソッドを使うと整形してくれることを今まで知らなかったので、これまで使っていこうと思います。p
のメソッド結果を探すのが大変で、近くにp "ああああああああああああ"
みたいな形にして目立つように書いてます。 :wakaru:@haruguchi
helper.mthod
でコンソールで確認できる@saki
app/views/layouts/application.html.erb
は自動的に作られる(rails new
とかのタイミング?)render :show, layout: 'awesome_book'
と書けばlayoutsテンプレートも指定できるpp
がないと生きていけません…!!🙏👼✨@paru871
@niikz
form_with
で簡単にフォームができてすごい本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK)
@maimu_x2x
@haruguchi
x2x
はなんだろう?maimu maimuと予想!@Saki
@paru871
LEF
@niikz
連絡事項や確認・相談
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →