Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6078699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:51:47+00:00 2026-05-23T10:51:47+00:00

Hello I am using Ruby on rails and JQgrid. Everything works fine but when

  • 0

Hello

I am using Ruby on rails and JQgrid. Everything works fine but when the grid load the data it is sorted in a way I don’t want. I need to be sorted descendent in the ID column.
I was not the one who developed this software so I don’t know exactly what to change. This code is in the helper of the quote controller and I think here is where I have to change it. Someone told me to use Quote.order(‘id DESC’) which is in the last line. I put it in the second line but nor of them is working properly. Could someone please tell me what needs to be added in order to accomplish it? There is also code in javascript. But that is very complex. I think I don’t need to change that.

I really appreciate. I have more than 2 moths trying to solve it. Thanks.

def format_quote_grid!
Quote.grid.update({
:title => "Quotes",
:pager => true,
:search_toolbar => :hidden,
:resizable => false,
:height => :auto,
:except => [:contacts],
:rows_per_page => 10}) { |grid|
  grid.column :id, :label => "Number", :width => 50#, :proc => lambda {|record| link_to record.number, quote_path(record) }
  grid.column :job_name, :width => 140, :proc => lambda {|record| link_to record.job_name, quote_path(record) }
  grid.column :category, :width => 60
  grid.column :needs_installation, :width => 60
  grid.column :contact_id, :hidden => true
  grid.column :business_id, :hidden => true
  grid.column :contact_name, :label => "Contact", :width => 100, :sortable => false, :proc => lambda {|record| link_to(record.contact.name, record.contact) if record.contact.present? }
  grid.column :business_name, :label => "Business", :width => 100, :sortable => false, :proc => lambda {|record| link_to(record.business.name, record.business) if record.business.present? }
  grid.column :scope_of_work_id, :hidden => true
  grid.column :markup, :hidden => true
  grid.column :notes, :hidden => true
  grid.column :shred, :hidden => true
  grid.column :printed_at, :hidden => true
  grid.column :created_at, :hidden => true
  grid.column :updated_at, :hidden => true
  grid.column :user_id, :hidden => true
  grid.column :actions, :width => 200, :sortable => false, :searchable => false, :proc => lambda {|record|
    permissioned_actions(record) do |p|
      p.show_link
      p.link('Printable', printable_quote_path(record), :show, record)
      p.edit_link
      p.destroy_link
      p.link('RFQ', request_for_quote_path(record.scope_of_work.request_for_quote_id), :show, record.scope_of_work) if record.scope_of_work.present?
      p.correspondence_link
      p.resources_link
      p.link(record.work_order.number, work_order_path(record)) if record.work_order
    end
  }
  Quote.order('id DESC')  #hecho por mi
}
  end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:51:47+00:00Added an answer on May 23, 2026 at 10:51 am

    Ok, from one of your earlier posts on this subject, it seems you are using Gridify.

    Gridify seems to support the following options:

    :sort_by    # name of sort column of next request
    :sort_order # sort direction of next request, 'asc' or 'desc' ('asc')
    

    So, I would add the following just below :except => [:contacts],

    :sort_by => :id,
    :sort_order => :desc,
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying out Ruby on Rails in Windows XP using the Hello World example.
I am using ruby on rails. Below given code works. However I was wondering
Hello i am using the latest version of artoolkit, and succesfully compiled simplevrml, but
Hello I have both Rails2 and Rails3(beta 3) installed by Ruby Gems. Everything right
I've just started using Ruby on Rails and so far it's working nicely. I'm
I am learning ruby on rails using aptana studio 3. I created a view
I've recently installed thinking-sphinx on my ruby on rails app. As first sight, everything
I am using Ruby on Rails 3.1.0 and the rspec-rails 2 gem. I would
How would I print Hello every nth of an iteration in ruby using something
I am using Ruby on Rails 3.1.0 and I would like to know what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.