LoginSignup
1
2

More than 5 years have passed since last update.

リダイレクト先に適応されるlayout

Posted at

ログインしていないユーザに対してリダイレクトで、ログインページに飛ばすときに、不用なheaderとかを外したかったので、ログインページ用のlayoutを専用に作ったのですが、そのレイアウトを

render :file => 'redirect_page', :layout => 'layout_name'

で適応させました。
redirect先のcontrollerの指定actionをずっと触っていて時間を食いました。
・redirectした場合、layoutはredirect前のものを適応させられてしまうため、action単位でのlayoutが使えなかった。
・redirect先のcontrollerの設定が間違っていただけで、本当はredirect先のcontrollerの設定だけでなんとかなるはずだった。
のいずれが原因だったかわかりませんが。。。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2