Displaying 6 results from an estimated 6 matches for "placement_pages".
2006 Feb 07
11
breaking down a list view
...r of a list view and it''s
obvious to me that I don''t understand what I get from a simple scaffold
to know enough to alter it.
If someone would be so kind to tell me what this means ...
def list
@placment_pages, @placements = paginate :placements, :per_page => 10
end
@placement_pages, # I am guessing that this calculates the total pages
@placements = paginate :placements, # I am guessing that this calculates
# pagination from total placements /
# :per_page value
:per_page => 10 # this one is obvious to...
2006 Feb 08
7
DRY methodology
because I am a grasshopper...
Now that I can sort my ''list''...is there a logical way of not repeating
myself to having essentially the same list view with multiple sorts?
i.e.
def list_cl
# ordered by clients last name
@placement_pages, @placements = paginate(
:placements,
:include => [:client],
:order_by => ''clients.last_name'',
:per_page => 14)
end
def list_fac
# ordered by facility
@placement_pages, @placements = paginate(
:placements,
:include => [:...
2006 Feb 18
1
sql logic is killing me
I know my thinking is sloppy.
I want to know how many clients currently in my facility are male...
My facilities_controller.rb
def list_fac
@placement_pages, @placements = paginate(
:placements,
:conditions => ["placements.facility_id = ?",
params[:facility_id] ],
:include => [:facility, :client],
:order_by => ''facilities.name, clients.last_name,
:per_page => 14)
@facility = Faci...
2006 Feb 19
8
building multiple find conditions
..._referral_date] ]
end
if params[:beg_discharge_date] != "" then
@vw_string3 = ["discharge_date between ? and ?",
params[:beg_discharge_date], params[:end_discharge_date] ]
end
-> @vw_string = [@vw_string1, @vw_string2, @vw_string3]
@placement_pages, @placements = paginate(
:placements,
:conditions => @vw_string,
:include => [:client, :case_manager, :facility],
:order_by => ''referral_date'',
:per_page => 14)
The above setup gives me an error ''undefined method '...
2006 Feb 07
0
trying to order a list view
...to create the
order.
The error...
NoMethodError in Placements#list
You have a nil object when you didn''t expect it!
The error occured while evaluating nil.facility
The code...
placements_controller.rb
def list
@client = Client.find(:all)
@facility = Facility.find(:all)
@placement_pages, @placements = paginate :placements, :order =>
@placements.facility.name, :per_page => 14
end
If I remove the :order => @placements.facility.name
I get the listing (unordered) with the facility.name column - no
problem. (facilies table is tied to placements table via foreign
keys/place...
2006 Feb 09
17
complicated finds are eating my sole
I abandoned ruby way for find_by_sql and still can''t get this...
@myplacement = Placement.find_by_sql(
"select * from placement where
:intake_date >= beg_intake_date
and
:intake_date <= end_intake_date")
just a simple date range...it''s killing me - If I knew how to load
placement controller into irb, I could probably try out finds
interactive mode...
Thanks