diff options
| author | Kir | 2011-11-16 14:41:29 +0400 |
|---|---|---|
| committer | Kir | 2011-11-16 14:41:29 +0400 |
| commit | 661590c630f022fc678c4d5664b497db13de6eec (patch) | |
| tree | 0c434d3e4560b6cb13c7184c31472dd824b5bbe5 /app/controllers/speakers_controller.rb | |
| parent | 61bd4dd67fdaee93af6994d539b86d46cd1c45f1 (diff) | |
| download | inboxes-0.0.1.tar.bz2 | |
Faye integration, resources under modulev0.0.1
Diffstat (limited to 'app/controllers/speakers_controller.rb')
| -rw-r--r-- | app/controllers/speakers_controller.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/app/controllers/speakers_controller.rb b/app/controllers/speakers_controller.rb deleted file mode 100644 index db90dbe..0000000 --- a/app/controllers/speakers_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -class SpeakersController < ApplicationController - before_filter :init_and_check_permissions - - def create - # check permissions - raise ActiveRecord::RecordNotFound unless params[:speaker] && params[:speaker][:user_id] - @user = User.find(params[:speaker][:user_id]) - - flash[:notice] = t("views.speakers.added") if @discussion.add_speaker(@user) - redirect_to @discussion - end - - def destroy - @speaker = Speaker.find(params[:id]) - @speaker.destroy - flash[:notice] = @speaker.user == current_user ? t("inboxes.discussions.leaved") : t("inboxes.speakers.removed") - redirect_to @discussion.speakers.any? && @discussion.can_participate?(current_user) ? @discussion : discussions_url - end - - private - - def init_and_check_permissions - @discussion = Discussion.find(params[:discussion_id]) - redirect_to discussions_url, :notice => t("inboxes.discussions.can_not_participate") unless @discussion.can_participate?(current_user) - end -end |
