Thank you, Tiago.
Do you mean to do something like this? Some of the stuff I put into
database at later time was still out of alphabetic order on my index
page.
class Product < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
product_name :string, :name => true, :order => "product_name"
On Mar 18, 12:14 pm, Tiago Franco <[email protected]> wrote:
> Hi,
>
> Probably the best way is to override the "find" method in your Product
> model.
>
> TF
>
> On Mar 18, 4:27 pm, Hobo_Fan <[email protected]> wrote:
>
> > Hi All,
>
> > I am trying to sort all my product listing in alphabetize order on my
> > product index page. I did add order by product_name in my product
> > controller; however, it did not take it. Is it possible to add order
> > by in <repeat with="&Product.all">
>
> > ProductsController.rb:
>
> > class ProductsController < ApplicationController
>
> > hobo_model_controller
>
> > auto_actions :all, :except => {:show, :index}
>
> > def index
> > �...@products = Product.find(:all, :order => "product_name")
>
> > Here is what is in my product index.dryml page.
> > <page title="Products">
> > <table>
> > <tr bgcolor="#DAA520">
> > <th>Product Name</th>
> > <th>Version</th>
> > <th>Operating System</th>
> > <th>Quantity</th>
> > <th>Order Date</th>
> > <th>Upgrade</th>
> > <th># of Clients</th>
> > <th># of Licenses Assigned</th>
> > </tr>
> > <repeat with="&Product.all">
> > <tr>
> > <td><a><view:product_name /></a></td>
> > <td><view:engine_version /></td>
> > <td><view:platform /></td>
> > <td><view:qty /></td>
> > <td><view:order_date /></td>
> > <td><view:upgrade /></td>
> > <td><count:clients/></td>
> > <td><count:licenses/></td>
> > </tr>
> > </repeat>
> > </table>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---