パRails🚂
rails s
できない可能性が高いです。
@hiromisugie
@ayu-0505
5-5-2 257p から
5-5-4 260p 「Action Textのカスタマイズ」まで。
PR:https://github.com/motohiro-mm/Perfect_Ruby_on_Rails_Ch5/pull/12
5-6 「Action Cableによるリアルタイム通信」から。🚂
@sharoa
@sadanora
ActionText::RichText
というモデルで管理されている。
with_rich_text_#{name}
とwith_rich_text_#{name}_and_embeds
embedded Ruby
らしいです
@shodan
Message
)とは違うモデルで管理されている。Message
モデルからリッチテキストを扱う属性名として使用したカラム名(今回だとcontent
)を直接参照すると、内部的には別の紐付けられたテーブルへアクセスするため、N+1問題がおきる可能性がある。eager_load
用のメソッドが用意されているので、そちらを使用する。@motohiro-mm
bin/rails g scaffold モデル名 属性名:rich_text
とすると、コントローラ、モデル、ビューをActionText用になおしてくれるwith_rich_text_属性名
:添付ファイルなしで本文をプリロードするwith_rich_text_属性名_and_embeds
:本文と添付ファイルを両方プリロードする@moegi29
@ayu-0505
with_rich_text_#{name}
とwith_rich_text_#{name}_and_embeds
がある。with_attached_attachment_name
が似たようなメソッドだと思った。@hiromisugie
message
のモデルにhas_rich_text :content
を設定:content
を設定content
を表示するように追加content:rich_text
をつけると自動的に設定できる。(できるんかい!と思った)@moegi
@shodan
5-6 「Action Cableによるリアルタイム通信」から
5-6-1 265pの途中まで。
PR:https://github.com/motohiro-mm/Perfect_Ruby_on_Rails_Ch5/pull/13
5-6-1 265p サーバサイドのコードを実装する から。🚂
@sharoa
@moegi29
@ayu-0505
bin/rails g channel チャネル名? メソッド名?
でAction Cable用のファイル類を作成できる。@shodan
rails g channel
でサーバサイド(rubyファイル)とクライアントサイド(JSファイル)の2つのファイルが生成できる。@sadanora
@hiromisugie
generate channel
のところから難しかった…@karlley
bundle lock
はBundlerのバージョンが上がって自身のplatformが追加されるように仕様が変わった際にbundle install
できないエラーに対応できる@motohiro-mm
--skip-git
のところはkarlleyさんのブログを参考にさせていただいてます!ありがとうございます!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