What i need
when user Click On Age or name or sex records
should be in that order as user clicked.if user clicked on age Twice
Then record should reverse . that would be bonus .
By default it Should Be As working now.
What i need
when user Click On Age or name or sex records
should be in that order as user clicked.if user clicked on age Twice
Then record should reverse . that would be bonus .
By default it Should Be As working now.
OK, so given that this isn’t a free-coding forum or a homework-for-you
forum, what do you need? Hints on how to do this? Do you have code
you’ve
tried that isn’t working?
I’ll start you with hints and you can then try it yourself…
The :order_by in your link_to will come through in the params hash in
your controller as params[:order_by]
You can use :order as an option to ActiveRecord find methods (along
with
“ASC” or “DESC” for ordering)
You’ll need to remember the current order if you want to toggle it on
clicks (or have it as another parameter in your link_to), you can use
the
session[:whatever_you_want] = … construct for that.
People are always happy to help, but you can’t just say “I need…”
there is a Write Query Running in my logger But Nothing happens .i
thinks
there must be a previous Code Which making my code Disable.Leave I have
to
consult my Senior .
any Ways thanks Again For the advice Which are More important for me
About
Manners
Thanks A lot.
there is a Write Query Running in my logger But Nothing happens .i
thinks
there must be a previous Code Which making my code Disable.
OK
Leave I have to consult my Senior .
any Ways thanks Again For the advice Which are More important for me About
Manners
Thanks A lot.
I assume this is sarcasm, but it’s really hard to tell.
Anyway, as I said I’m happy to help, but I need to know where you’re
at/what
the problem is (not just the requirement) and also need to feel valued
that
you’re not just using me/others here for free coding.
Cheers,
Andy
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.