Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F906970
users_controller.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Aug 30, 12:08 PM
Size
407 B
Mime Type
text/x-ruby
Expires
Mon, Sep 1, 12:08 PM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
253149
Attached To
rWEBDNS WebDNS (edet4)
users_controller.rb
View Options
class
UsersController
<
ApplicationController
before_action
:authenticate_user!
before_action
:user
,
only
:
[
:token
,
:generate_token
]
# GET /users/1/token
def
token
end
# POST /users/1/generate_token
def
generate_token
@user
.
token
=
SecureRandom
.
hex
(
10
)
@user
.
save!
redirect_to
token_user_path
(
@user
)
end
private
def
user
@user
||=
User
.
find
(
params
[
:id
]
)
end
end
Event Timeline
Log In to Comment