Sha256: 16521b7b400d1c2e3968887eeae35dc0c9b70a8f1a27b4421383f920d7d3d394

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

class UsersController < ApplicationController
  helper :pagination
  
  def index
    @users = User.find_all nil, 'username'
  end
  
  def method_missing(method)
    @user  = User.find_by_username(method.to_s)
		redirect_to_main and return unless @user
		
    @post_pages, @posts = paginate :posts,
                                   :conditions => ['user_id = ?', @user.id],
                                   :order_by   => 'created_at DESC', 
                                   :per_page   => @user.posts_per_page
                                   
    render 'post/index'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
EliteJournal-1.9.480 app/controllers/users_controller.rb