Tiago,
Thanks for your assistance to this noobie.
It turned out that I was doing several wrong things. The code below
is what I wanted and it now works. I had to create a new application
where I clarified all the model names and corresponding TABLEs created
via migration.
def index
hobo_index Lmduser.apply_scopes(:search =>
[params[:search], :username, :user_last_nm, :user_first_nm],
:order_by =>
parse_sort_param(:username, :user_last_nm, :user_first_nm))
end
Thanks,
Edmund
On Sep 18, 9:53 am, GamaFranco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> With table-plus you would be able to sort the by username,
> user_last_nm or user_first_nm. When you click in one of the collmn
> names the table doesn't sort using that column?
>
> With [params[:search], :user_last_nm] you would only be able to search
> by the user_last_nm.
>
> I think that you need to replace [params[:search], :user_last_nm] by
> [params[:search], :user_last_nm, username, user_first_nm]. This would
> allow the search to work on the three columns.
>
> Regards,
> Tiago Franco
>
> On Sep 18, 12:38 pm, Edmund <[EMAIL PROTECTED]> wrote:
>
> > I tried the code below based on the agility tutorial:
> > <<<<<
> > class LmdUsersController < ApplicationController
> > hobo_model_controller
> > # auto_actions :all
> > auto_actions :read_only #, :except => :index
>
> > def show
> > @lmduser = find_instance
> > @lmdusers =
> > @lmduser.apply_scopes(:search =>
> > [params[:search], :user_last_nm],
> > :order_by =>
> > parse_sort_param(:user_last_nm, :user_first_nm))
> > end
> > end
>
> > I am not able to sort on any of the displayed fields. I don't even
> > know how to code default sorting in hobo/rails. Is there a way to
> > declare a default sort in the model?
>
> > Edmund
>
> > On Sep 18, 6:40 am, GamaFranco <[EMAIL PROTECTED]> wrote:
>
> > > Are you able to sort?
>
> > > I think that the filtering is performed using the serarch box. What
> > > code did you put in the controller?
>
> > > TF
>
> > > On Sep 17, 7:13 pm, Edmund <[EMAIL PROTECTED]> wrote:
>
> > > > This is my index.dryml for the app\views\lmd_users folder:
>
> > > > <index-page>
> > > > <collection: replace>
> > > > <table-plus fields="username, user_last_nm, user_first_nm">
> > > > <empty-message:>No LMD Users match your criteria</empty-
> > > > message:>
> > > > </table-plus>
> > > > </collection:>
> > > > </index-page>
>
> > > > I get the columns that I want but I wanted to be able to sort and
> > > > filter the results. The agility tutorial has an example for sorting
> > > > the "Stories" in the "Projects" page and I tried that route but
> > > > without success.
>
> > > > Any help towards the right direction would be appreciated.
>
> > > > Thanks,
> > > > Edmund
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---