Skip to content

Commit

Permalink
Fix routing back problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Jupiterrr committed Sep 21, 2015
1 parent 0381aab commit fa378cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def subscribe
format.html { redirect_to :back, notice: 'Erfolgreich angemeldet' }
format.json { render json: { message: "Erfolgreich angemeldet" } }
end
rescue ActionController::RedirectBackError
redirect_to event_path(event)
end

def unsubscribe
Expand All @@ -39,16 +41,19 @@ def unsubscribe
format.html { redirect_to :back, notice: "Erfolgreich entfernt" }
format.json { render json: { message: "Erfolgreich entfernt" } }
end
rescue ActionController::RedirectBackError
redirect_to event_path(event)
end

def unsubscribe_all
trigger_ical_update
EventUnsubscriber.unsubscribe_all(current_user)

respond_to do |format|
format.html { redirect_to :back, notice: "Erfolgreich entfernt" }
format.json { render json: { message: "Erfolgreich entfernt" } }
end
rescue ActionController::RedirectBackError
redirect_to root_path
end

# def edit_user_text; end
Expand Down

0 comments on commit fa378cc

Please sign in to comment.