Sha256: 55071d4270fd7ed49f99c10b0501593df32b5940b2b45c194cc6a021f62bc71e

Contents?: true

Size: 683 Bytes

Versions: 3

Compression:

Stored size: 683 Bytes

Contents

module Formol
  class PreferencesController < ApplicationController
    respond_to :html
    
    def show
      preference
      
      respond_with(preference)
    end
    
    def update
      if preference.update_attributes(params[:user_preference])
        respond_with(preference) do |format|
          format.html { redirect_to preference_path }
        end
      # No wrong case to test for now
      # just lower coverage
      # 
      #else
      #  respond_with(preference) do |format|
      #    format.html { render :show }
      #  end
      end
    end
    
    protected
    
    def preference
      @preference ||= current_formol_user.preference
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formol-0.0.6 app/controllers/formol/preferences_controller.rb
formol-0.0.5 app/controllers/formol/preferences_controller.rb
formol-0.0.4 app/controllers/formol/preferences_controller.rb