Class: Collavre::CreativeInvitationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Collavre::CreativeInvitationsController
- Defined in:
- app/controllers/collavre/creative_invitations_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/controllers/collavre/creative_invitations_controller.rb', line 21 def destroy @invitation.destroy respond_to do |format| format.html { redirect_back fallback_location: main_app.root_path, notice: t("collavre.contacts.org_chart.invite_cancelled") } format.json { head :no_content } end end |
#update ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/collavre/creative_invitations_controller.rb', line 7 def update if @invitation.update(permission: params[:permission]) respond_to do |format| format.html { redirect_back fallback_location: main_app.root_path, notice: t("collavre.creatives.share.permission_updated") } format.json { render json: { permission: @invitation. }, status: :ok } end else respond_to do |format| format.html { redirect_back fallback_location: main_app.root_path, alert: @invitation.errors..to_sentence } format.json { render json: { error: @invitation.errors..to_sentence }, status: :unprocessable_entity } end end end |