2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-01-11 13:58:13 +00:00
|
|
|
class Settings::NotifiersController < ApplicationController
|
|
|
|
before_filter :authenticate_user!
|
|
|
|
|
|
|
|
load_and_authorize_resource :user
|
|
|
|
load_and_authorize_resource :class => Settings::Notifier, :through => :user, :singleton => true, :shallow => true
|
|
|
|
|
|
|
|
def show
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
if @notifier.update_attributes(params[:settings_notifier])
|
|
|
|
flash[:notice] = I18n.t("flash.settings.saved")
|
2012-01-18 19:12:52 +00:00
|
|
|
redirect_to user_settings_notifier_path(@user)
|
2012-01-11 13:58:13 +00:00
|
|
|
else
|
|
|
|
flash[:notice] = I18n.t("flash.settings.save_error")
|
2012-01-18 19:12:52 +00:00
|
|
|
redirect_to user_settings_notifier_path(@user)
|
2012-01-11 13:58:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|