viewを先に整えたいので、rootにアクセスした時に、view/todos/index.html.erbをcontrollerを通さずに返したいです。
route
Rails.application.routes.draw do get "/" , to: render('/todos') end
エラー
undefined method `render' for #<ActionDispatch::Routing::Mapper:0x00007ff06d4ac878>
redirectに変更した時
No route matches [GET] "/todos" Helper HTTP Verb Path Controller#Action Path / Url Path Match GET / redirect(301, /todos)
普通はcontrollerを作成して、controllerからviewに返す方法はわかっているのですが、TDDでTODOリストを開発したく、controllerはviewの整形をした後に作成したいです
よろしくお願いします
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/23 08:39