Sha256: 7111e3e7eafd9867b25c951342a1f7448d6c232cdb8ae30f71c4972353187d17

Contents?: true

Size: 385 Bytes

Versions: 13

Compression:

Stored size: 385 Bytes

Contents

class ProfilesController < InheritedResources::Base
  respond_to :html
  before_filter :load_current_user
  belongs_to :user, :optional => true, :singleton=>true

  def load_current_user
    unless params[:user_id]
      @user ||= (current_user ? User.find(current_user.id) : User.super_user)
    end
  end

  def resource
    @profile ||= Profile.find_by_user_id(@user.id)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wheels-0.0.17 app/controllers/profiles_controller.rb
wheels-0.0.16 app/controllers/profiles_controller.rb
wheels-0.0.15 app/controllers/profiles_controller.rb
wheels-0.0.14 app/controllers/profiles_controller.rb
wheels-0.0.13 app/controllers/profiles_controller.rb
wheels-0.0.11 app/controllers/profiles_controller.rb
wheels-0.0.10 app/controllers/profiles_controller.rb
wheels-0.0.9 app/controllers/profiles_controller.rb
wheels-0.0.8 app/controllers/profiles_controller.rb
wheels-0.0.6 app/controllers/profiles_controller.rb
wheels-0.0.5 app/controllers/profiles_controller.rb
wheels-0.0.4 app/controllers/profiles_controller.rb
wheels-0.0.3 app/controllers/profiles_controller.rb