Class: FollowingsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- FollowingsController
- Defined in:
- app/controllers/followings_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
4 5 6 7 |
# File 'app/controllers/followings_controller.rb', line 4 def create @following = current_user.followings.create(followed: followed) redirect_to followed, notice: "Agora você está observando #{followed.name}!" end |
#destroy ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/followings_controller.rb', line 8 def destroy @following = current_user.followings.find_by_followed_id!(followed.id) @following.destroy redirect_to followed, notice: "Você deixou de observar #{followed.name}!" end |