aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-04-25 02:31:58 -0400
committerGitHub <noreply@github.com>2018-04-25 02:31:58 -0400
commit03721d9379c0eeb8b0c93c92301ba7a9caa436a2 (patch)
tree8e49efbe4f880e16b5ddad2a3afb35739616865c /guides
parent90be2329b47081006cdcab2107d23ce132ad4023 (diff)
parentd2fd01ec68f31bc6f2e5aee5344b3ad4a019df2d (diff)
downloadrails-03721d9379c0eeb8b0c93c92301ba7a9caa436a2.tar.gz
rails-03721d9379c0eeb8b0c93c92301ba7a9caa436a2.tar.bz2
rails-03721d9379c0eeb8b0c93c92301ba7a9caa436a2.zip
Merge pull request #32702 from bogdanvlviv/fix-description-for-31685
Fix title for example of removing data from `session` [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_controller_overview.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md
index 4e3319dec4..cd685a228e 100644
--- a/guides/source/action_controller_overview.md
+++ b/guides/source/action_controller_overview.md
@@ -450,7 +450,7 @@ class LoginsController < ApplicationController
end
```
-To remove something from the session, assign that key to be `nil`:
+To remove something from the session, delete the key/value pair:
```ruby
class LoginsController < ApplicationController
@@ -478,7 +478,7 @@ Let's use the act of logging out as an example. The controller can send a messag
```ruby
class LoginsController < ApplicationController
def destroy
- session[:current_user_id] = nil
+ session.delete(:current_user_id)
flash[:notice] = "You have successfully logged out."
redirect_to root_url
end