LoginSignup
1
0

More than 3 years have passed since last update.

renderとredirect_toの違い

Posted at

render

次に指定するViewを指定している。
今持っている変数で新しいViewを構成する。

redirect_to

次に指定するメソッドを指定している。
ブラウザに対して指定したメソッドにHTTPリクエストを送るように司令する。
リクエストが二回発生してしまうことになる。

例:
=> GET home/show
<= redirect_to
=> Get home/index
<= home/index

1
0
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
0