Displaying 9 results from an estimated 9 matches similar to: "pagination for an object array"
2008 May 19
0
changed to will_paginate
Hi
Till now we used the rails pagination.But now onwards shifting to
will_paginate
The code I use currently is as below .This is with the help of
find_where pluggin..A fantastic pluggin which we still want to use...I
would like to know how can i modify the following code to work with
will_paginate
step 1: set the variables you''ll need
page = (params[:page] ||= 1).to_i
2008 Apr 26
0
moving pagination code to model
Hi
I have the controller code as below
# step 1: set the variables you''ll need
page = (params[:page] ||= 1).to_i
items_per_page = 20
offset = (page - 1) * items_per_page
# step 2: instead of performing the full find, just find the
record count
@search_sd_ticket_count_result =
2008 Sep 25
1
question about exception
Hi
In the controller I have the function
def convert_sd_ticket_to_incident
ServiceDeskTicket.close_ticket(sd_id,created_by_id,modified_by_id)
Incident.convert_sd_ticket_to_incident(sd_id,created_by_id,modified_by_id)
end
Now in the ServiceDeskTicket model
def self.close_ticket(sd_id,created_by,modified_by)
begin
ActiveRecord::Base.transaction do
2008 Jun 16
2
call_backs Is it?
Hi
I have the models
1.ServiceDeskTicket with fields
id --- number --- service_desk_status_id -- created_on -- updated_on
etc
2.ServiceDeskActivity with fields
id -- service_desk_ticket_id -- description -- created_on --
updated_on
3.ServiceDeskAttachment
id -- service_desk_ticket_id -- attachment -- created_on --
updated_on
Relations as
ServiceDeskticket has_many
2008 May 13
4
calling another rjs file in an if condition
Hi
I have a controller action like below.This def is called by a
submit_to_remote
def edit_service_desk_status_after_transfer
if params[:transfer_reason].empty?
#This is used in the :failure of submit_to_remote
else
@sd_ticket = ServiceDeskTicket.find(params[:sd_id])
ActiveRecord::Base.transaction do
@sd_status_history = ServiceDeskStatusHistory.new
2008 May 26
0
setfocus to a field in view
Hi
I have a div "reason_for_transfer_search_sd" like
<div id="reason_for_transfer_search_sd" >
<%= render :partial =>
"service_desk_part/on_action_transfer_reason_sd_search", :locals => {
:sd_ticket=>sd_ticket } %>
</div>
And in on_action_transfer_reason_sd_search
<%= text_area_tag "transfer_reason", nil, :size =>
2008 Mar 06
2
GateKeeper, Model Level Permissions Management
I''m pleased to announce the official release of "GateKeeper".
GateKeeper is a Rails plugin that provides easy to use methods to
declare access permissions to instances of ActiveRecord classes at the
model level. Permissions may be based on either a user''s roles (such as
Admin, Moderator, etc) or on associations with other models.
In most simple and straight forward
2008 Oct 27
8
pagination in ajax
hi,
I am curently using rails version 2.1.1.
Currently i have done simple pagination using will_paginate
plugin.it works.but when i am trying pagination using ajax
with help of will_paginate plugin
it wont works.i am also using RemoteLinkRenderer helper,
but it gives an error uninitialized constant RemoteLinkRenderer.
can anyone provide any tutorial or sample code so that i can
2006 Jun 30
3
New release of ez-where plugin
Hello friends-
There is a new release of the ez-where plugin. This plugin makes it
easy to do complex ActiveRecord queries without writing any SQL. Ruby
operators are mapped to SQL operators like so:
foo == ''bar'' #=> ["foo = ?", ''bar'']
foo =~ ''%bar'' #=> ["foo LIKE ?", ''%bar'']