rails 5.1.6 でアプリケーションを作成しています。
下記のコードで、descriptionを記述しているのですが、半角スペースの部分でdescriptionが途切れてしまいます。
▼ 該当のviewファイル
<% content_for(:description) { "ここにdescriptionを記述" } %>
▼ 出力する側の共通viewファイル
<meta name="description" content=<%= content_for?(:description) ? yield(:description) : "" %>>
例えば
以下のようなコードをviewファイルに置いた場合
<% content_for(:description) { "put description here" } %>
▼ 結果(ChromeのDevToolで確認したときの表示)
<meta name="description" content="put" description here>
▼ 本当はこうなってほしい
<meta name="description" content="put description here">
こちらの解決方法がわかる方、または検討がつく方がいれば、アドバイスいただけますと幸いです。よろしくお願いいたします!
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。