Sha256: cb259701bb94d265f6baceaa048b8f86aee446aa6403c9c1d135bed892445663

Contents?: true

Size: 1.03 KB

Versions: 68

Compression:

Stored size: 1.03 KB

Contents

class SettingsController < ApplicationController
    
  before_filter :authenticate_user!
  
  def index
  end

  def update_all
    success = false

    #If no section selected, skips and gives error
    if params[:settings_section].present?
      section = params[:settings_section].to_s

      #Updating notifications settings
      if section.eql? "notifications"
        #Notify by email setting
        if params[:notify_by_email].present?
          notify_by_email = params[:notify_by_email].to_s
          current_subject.notify_by_email = false if notify_by_email.eql? "never"
          current_subject.notify_by_email = true if notify_by_email.eql? "always"
        end
      end

      #Here sections to add
      #if section.eql? "section_name"
      #   blah blah blah
      #end

      #Was everything ok?
      success = current_subject.save
    end

    #Flashing and redirecting
    if success
      flash[:success] = t('settings.success')
    else
      flash[:error] = t('settings.error')
    end
    render :action => :index
  end

end

Version data entries

68 entries across 68 versions & 4 rubygems

Version Path
vkhater-social_stream-0.16.3.3 base/app/controllers/settings_controller.rb
vkhater-social_stream-base-0.11.2 app/controllers/settings_controller.rb
social_stream-0.16.3 base/app/controllers/settings_controller.rb
social_stream-base-0.11.2 app/controllers/settings_controller.rb
social_stream-0.16.2 base/app/controllers/settings_controller.rb
social_stream-base-0.11.1 app/controllers/settings_controller.rb
social_stream-0.16.1 base/app/controllers/settings_controller.rb
social_stream-base-0.11.0 app/controllers/settings_controller.rb
social_stream-0.15.8 base/app/controllers/settings_controller.rb
social_stream-base-0.10.11 app/controllers/settings_controller.rb
social_stream-0.15.7 base/app/controllers/settings_controller.rb
social_stream-base-0.10.10 app/controllers/settings_controller.rb
social_stream-0.15.6 base/app/controllers/settings_controller.rb
social_stream-base-0.10.9 app/controllers/settings_controller.rb
social_stream-0.15.5 base/app/controllers/settings_controller.rb
social_stream-base-0.10.8 app/controllers/settings_controller.rb
social_stream-0.15.4 base/app/controllers/settings_controller.rb
social_stream-base-0.10.7 app/controllers/settings_controller.rb
social_stream-0.15.1 base/app/controllers/settings_controller.rb
social_stream-0.15.0 base/app/controllers/settings_controller.rb