Class: Boxroom::ShareLinksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Boxroom::ShareLinksController
- Includes:
- BaseController
- Defined in:
- app/controllers/boxroom/share_links_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Note: @file and @folder are set in require_existing_file.
-
#destroy ⇒ Object
Note: @share_link is set in require_existing_share_link.
- #index ⇒ Object
-
#new ⇒ Object
Note: @file is set in require_existing_file.
-
#show ⇒ Object
Note: @file is set in require_existing_file.
Instance Method Details
#create ⇒ Object
Note: @file and @folder are set in require_existing_file
28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/boxroom/share_links_controller.rb', line 28 def create @share_link = @file.share_links.build(permitted_params.share_link) @share_link.user = current_user if @share_link.save UserMailer.share_link_email(@share_link).deliver_now redirect_to @folder, :notice => t(:shared_successfully) else render :action => 'new' end end |
#destroy ⇒ Object
Note: @share_link is set in require_existing_share_link
41 42 43 44 |
# File 'app/controllers/boxroom/share_links_controller.rb', line 41 def destroy @share_link.destroy redirect_to share_links_url end |
#index ⇒ Object
13 14 15 |
# File 'app/controllers/boxroom/share_links_controller.rb', line 13 def index @share_links = ShareLink.active_share_links end |
#new ⇒ Object
Note: @file is set in require_existing_file
23 24 25 |
# File 'app/controllers/boxroom/share_links_controller.rb', line 23 def new @share_link = @file.share_links.build end |
#show ⇒ Object
Note: @file is set in require_existing_file
18 19 20 |
# File 'app/controllers/boxroom/share_links_controller.rb', line 18 def show send_file @file..path, :filename => @file. unless @file.nil? end |