Displaying 2 results from an estimated 2 matches for "callscontroller".
Did you mean:
call_controller
2008 Jul 14
1
will_paginate paginates all instead of subclass
...#39;'id DESC''
end
end
def self.search(search, page)
paginate :per_page => 4, :page => page,
:conditions => [''name like ?'', "%#{search}%"],
:order => ''name''
end
end
And my controller for CallsController with index action
class CallsController < ApplicationController
before_filter :login_required, :only =>
[ :new, :create, :show, :index, :list, :all_show, :edit, :update, :delete ]
def index
@calls = Call.search(params[:search], params[:page])
end
my view page for index is
&l...
2008 Feb 09
0
MVC interplay to query multiple models
...ool $
thufir@arrakis ~/goodfellow-tool $ cat app/models/call.rb
class Call < ActiveRecord::Base
belongs_to :login
def report
Call.find(:all, :include => [:login, :login])
end
end
thufir@arrakis ~/goodfellow-tool $
And mongrel reports:
Processing CallsController#show (for 127.0.0.1 at 2008-02-08 22:58:53)
[GET]
Session ID: fd47ae8903e9f82697145c71e7b3d43d
Parameters: {"action"=>"show", "id"=>"1", "controller"=>"calls"}
Call Load (0.001115) SELECT * FROM calls WHERE (calls."i...