Class: ProjectFollowsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ProjectFollowsController
- Defined in:
- app/controllers/project_follows_controller.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
Methods inherited from ApplicationController
#after_sign_in_path_for, #api_authenticate!, #authenticated_via_token?, #current_project, #expire_revision!, #followed_projects, #no_cache, #oauth_authorize!, #read_revision, #require_login, #return_or_cache_revision!, #revision, #token_authenticate!, #unfurling?, #with_current_project
Methods included from UrlHelper
#feature_path, #link_to_project_feature
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
2 3 4 |
# File 'app/controllers/project_follows_controller.rb', line 2 def project @project end |
Instance Method Details
#create ⇒ Object
6 7 8 9 |
# File 'app/controllers/project_follows_controller.rb', line 6 def create current_user.follow! project redirect_to :back, notice: "You are now following #{project.name}" end |
#destroy ⇒ Object
11 12 13 14 |
# File 'app/controllers/project_follows_controller.rb', line 11 def destroy current_user.unfollow! project redirect_to :back, notice: "You are no longer following #{project.name}" end |