Sha256: 9509e3be968909f2f76780c0bd1d91108defe32775b3b90347ce7d33d5b4351d

Contents?: true

Size: 902 Bytes

Versions: 32

Compression:

Stored size: 902 Bytes

Contents

class UsersController < InheritedResources::Base
  load_and_authorize_resource

  respond_to :html, :xml, :js
  
  def index
    @users = User.alphabetic.
                  letter(params[:letter]).
                  name_search(params[:search]).
                  tagged_with(params[:tag]).
                  page(params[:page]).per(10)

    index! do |format|
      format.html { render :layout => (user_signed_in? ? 'application' : 'frontpage') }
    end
  end

  def show
    show! do |format|
      format.html { render :layout => (user_signed_in? ? 'application' : 'frontpage') }
    end
  end

  # Supported through devise
  def new; end; def create; end
  # Not supported yet
  def destroy; end

  protected

  # Overwrite resource method to support slug
  # See InheritedResources::BaseHelpers#resource
  def resource
    @user ||= end_of_association_chain.find_by_slug!(params[:id])
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
social_stream-0.11.1 base/app/controllers/users_controller.rb
social_stream-base-0.9.16 app/controllers/users_controller.rb
social_stream-0.11.0 base/app/controllers/users_controller.rb
social_stream-base-0.9.15 app/controllers/users_controller.rb
social_stream-0.10.4 base/app/controllers/users_controller.rb
social_stream-base-0.9.14 app/controllers/users_controller.rb
social_stream-0.10.3 base/app/controllers/users_controller.rb
social_stream-base-0.9.13 app/controllers/users_controller.rb
social_stream-0.10.2 base/app/controllers/users_controller.rb
social_stream-base-0.9.12 app/controllers/users_controller.rb
social_stream-0.10.1 base/app/controllers/users_controller.rb
social_stream-0.10.0 base/app/controllers/users_controller.rb
social_stream-base-0.9.11 app/controllers/users_controller.rb
social_stream-0.9.7 base/app/controllers/users_controller.rb
social_stream-base-0.9.10 app/controllers/users_controller.rb
social_stream-0.9.6 base/app/controllers/users_controller.rb
social_stream-base-0.9.9 app/controllers/users_controller.rb
social_stream-0.9.5 base/app/controllers/users_controller.rb
social_stream-base-0.9.8 app/controllers/users_controller.rb
social_stream-0.9.4 base/app/controllers/users_controller.rb