Displaying 12 results from an estimated 12 matches for "sort_ord".
Did you mean:
sortord
2006 Oct 23
3
passing parameter to action
i have a table of data in my application. i would like to be able to
sort the data in the table by clicking on the column header. the way
i was thinking i want to do this is just by making a ''sort'' action,
and then calling the sort action from each link in the table header
(passing the respective column name). it doesn''t seem to be possible
to pass parameters to an
2011 Apr 07
0
Refactor sorting of images
...has a next_picture and prev_picture method, so that it can
fetch it''s successor and predecessor.
## pictures_controller
def index
..
@pictures = Picture.where(:state => ''published'').paginate :page =>
params[:page], :per_page => per_page, :order => "#{sort_order.to_s}
DESC"
..
end
## pictures model
def prev_picture
prev_picture = self.class.where(sort_order.gte =>
send(sort_order), :uid.ne => uid, :state =>
''published'').order(sort_order).first
return nil if prev_picture.blank?
if send(sort_order).eql?(prev_...
2005 Oct 05
2
customer defined sort order
I have a category list which the customer wants administratively to define
the sort order, instead of alphabetical or whatever. The obvious approach
seems to be to put a sort_order int on the record and use this as the
presentation sort order. Then to shift the item up in the sort order to swap
the current and the prevous item in the sort_order.
Does this seem like a sensible approach, or is there an easier way?
_______________________________________________
Rails maili...
2006 Aug 17
8
Creating queries..
...am trying to implement a few queries now. What are good ways to do
this?
Right now, I have a list page that does sorting and can carry out a
generic pagination request.
@user_result_pages, @user_results = paginate(:user_results,
:per_page => 20,
:conditions => @condition,
:order_by => @sort_order)
I create @sort_order earlier in the list function. The problem I am
having is with ''@condition'' I''m not sure what''s the best way to create
this. There are a number of options that my user may select:
1. date > ...
2. range of dates
3. specific dates
4. n...
2009 Apr 05
5
Use a value from a different model
...r (saving_controller):
class SavingController < ApplicationController
def index
@category = Category.find(:all).collect {|c| [ c.name, c.id ] }
@subcategory = Subcategory.find(:all).collect {|c| [ c.name,
c.id ] }
@purchaseType = PurchaseType.find(:all).collect {|c| [ c.name,
c.id ] }
sort_order = params[:sort_by]
sort_order ||= ''id'' # for default sort
@saving = Saving.search(params[:search], params[:page], sort_order)
end
end
the saving model (saving - table name = savings):
class Saving < ActiveRecord::Base
validates_presence_of :supplier,
:a_saving,...
2006 Aug 14
5
Tutorial for Queries
Hi! I''m looking for a good tutorial that explains the main points of
performing queries with Rails. I do have AWDWR and have read the
section on ''find'' but I''m looking for something that goes into more
detail on how to perform queries across tables.
Abstracted from my current application, this is an example:
* person has_many sites
* site has_one room
*
2007 Nov 30
2
make sortable divs and innerHTML
My problem is that elements that were included in my site with
innerHTML can´t be sortable because the DOM doesn´t know that these
elements are there.
Has anybody a solution or an idea to this problem?
ToM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group,
2018 Jan 19
1
Web scraping different levels of a website
...quot;http://catalog.ihsn.org/index.php/catalog/",
"search?view=s&",
"ps={num_studies}&",
"page=1&repo=&repo_ref=&sid=&_r=&sk=&vk=&",
"from={year_from}&",
"to={year_to}&",
"sort_order=&sort_by=nation&_=1516371984886")
# read in the html
x <-
url %>%
GET() %>%
content()
# option 1 (div with class "survey-row" --> data-url attribute)
x %>%
html_nodes(".survey-row") %>%
html_attr("data-url")
# option 2 (stu...
2006 Mar 17
10
breadcrumbs?
Before I start down this road, has anyone done a breadcrumbs
implementation they''d be happy to share?
Thanks
Chris T
2005 Mar 04
4
Upgrading broke the .find methods???
I just updated to rails (via gem) and now all my .find..... methods
give me "wrong number of arguments(3 for 0)" with the exception of
find_by_sql which works fine but I want to avoid for obvious reasons.
I''ve tried simplifying everything down to the bare minimum
Priorities.find(1)
and I printed out Priority.table_name to confirm it was still correct.
What gives? Did I
2006 May 17
3
Help mixin in class methods
Starting to feel more confident and code is DRYing up nicely, but I''ve
hit a brick wall here and hoping someone can help me.
I''ve got a module, TrustRanking, which extends a number of model''s
instance methods, and I want to extend their class methods too, but I
can seem to work out how to do it.
Simply including the module from the class works a treat for the
2009 Sep 30
17
Apache2.2 + what to get Rails
Me: not experienced with Rails or Ruby,
Problem: Ubuntu 9.04 server in my shop ...couldn''t get Apache2.2 +
Passenger + Rails to work for Redmine. (No answer at Redmine list and
I don''t think its their problem anyway). Also couldn''t get Apache2.2
and just Rails to work, though some people said it would. Webrick
works.
Goal: run Redmine on a server that also runs PHP