Displaying 6 results from an estimated 6 matches for "person_pag".
Did you mean:
person_pages
2006 Jan 31
6
Pagination - why is it this hard?
...sh, but I''m incredibly frustrated by
this. I''ve been hacking on it for hours now, and I can''t launch this
version of my app without proper pagination. The deadline is today,
and I figured this would be a lot easier than it seems to be.
Code:
Controller:
def list
@person_pages, @people = paginate :person, :order => ''last_name
ASC'', :per_page => 20
end
def search
searchconditions = []
if params.include?(:letter)
searchconditions = ["LOWER(last_name) LIKE ?",
params[:letter].to_str + "%"]
elsif params.inc...
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone,
I have this code:
@person_pages, @people = paginate :person, :per_page => 20,
:conditions => [ "username LIKE ? OR first_name LIKE ? OR
last_name LIKE ? OR preferred_name LIKE ?",
"%" + params[:q].downcase + "%",
"%" + params[:q].downc...
2006 Feb 15
10
STI Question
Hi everyone,
I have 3 types of people (for now):
Staff
Faculty
Students
To break them up into classes, but keep them in the same People table,
I''ve broken them up like so (code and ''ends'' snipped):
class Person < ActiveRecord::Base
class Employee < Person
class Staff < Employee
class Faculty < Employee
class Student < Employee
So, when I insert
2006 Jan 04
8
Trying to display data from two tables
...if exists person_kinds;
CREATE TABLE `person_kinds` (
`id` int(6) NOT NULL auto_increment,
`kind` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
)
###########################
Using ruby script/generate scaffold
Controllers;
class PersonAdminController < ApplicationController
def list
@person_pages, @people = paginate(:people, :order_by =>''lastname'',
:per_page => 10)
@person_kinds = PersonKind.find_all
end
class PersonKindAdminController < ApplicationController
###########################
Models
class Person < ActiveRecord::Base
belongs_to :person_k...
2006 Jan 30
0
Making sense of all the search options
Hi everyone,
I have an app that manages accounts. There''s a search function that I
don''t like, but it works:
@person_pages, @people = paginate :person, :per_page => 20,
:conditions => [ "LOWER(username) LIKE ? OR LOWER(first_name)
LIKE ? OR LOWER(last_name) LIKE ? OR LOWER(preferred_name) LIKE ?",
"%" + session[:q] + "%",
"%"...
2006 Jan 08
2
sorting tables by columns
What I''m trying to do is have clickable column headers that will sort
the table by that column. What I have below works, except there is only
one variable storing the sort direction for all the columns, whereas I
need a separate one for each column name.
list view:
<th><%= link_to ''Category'', :action => ''list'', :order =>