Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Ruby インスタンス変数は、単一のオブジェクトからアクセスできます。しかし Rails では、コントローラでインスタンス変数を宣言すると、ビューで引き続きアクセスできます。この背後にあるアーキテクチャは何ですか?
さて、コントローラーはrenderテンプレートをレンダリングする呼び出しを行います。したがって、テンプレート コードはコントローラー インスタンスのスコープ内で実行されます。したがって、宣言された任意のインスタンス変数を使用できます。
render