Sha256: fcc3d6e290bc09a52bf0db8a67a22b9526b0886eb2f90cf9066c02a1a18cc2b2

Contents?: true

Size: 897 Bytes

Versions: 10

Compression:

Stored size: 897 Bytes

Contents

class UsersController < InheritedResources::Base
  load_and_authorize_resource

  respond_to :html, :xml, :js
  
  def index
    @users = User.alphabetic.
                  letter(params[:letter]).
                  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

10 entries across 10 versions & 1 rubygems

Version Path
social_stream-base-0.8.0 app/controllers/users_controller.rb
social_stream-base-0.7.11 app/controllers/users_controller.rb
social_stream-base-0.7.10 app/controllers/users_controller.rb
social_stream-base-0.7.9 app/controllers/users_controller.rb
social_stream-base-0.7.8 app/controllers/users_controller.rb
social_stream-base-0.7.7 app/controllers/users_controller.rb
social_stream-base-0.7.6 app/controllers/users_controller.rb
social_stream-base-0.7.5 app/controllers/users_controller.rb
social_stream-base-0.7.4 app/controllers/users_controller.rb
social_stream-base-0.7.3 app/controllers/users_controller.rb