similar to: Ordering across related tables

Displaying 20 results from an estimated 10000 matches similar to: "Ordering across related tables"

2006 Jan 02
6
Paginate with joins messing with id
Hi all, Best wishes for the new year! :'') I''m very new to Ruby and Rails, and I ran into a problem with the "paginate" function. When I use the following method to get a number of forum topics based on a category name passed via the URI: @topic_pages, @topics = paginate :topics, :joins => "INNER JOIN categories ON
2006 Jun 13
2
four days on rails - nil object when you didnt expect it
Hi all, Im trying to get my head around rails and to help along Im working through "four days on rails" as this seems to give a good real world example with multiple tables and relationships (the main thing I cant work out!) Ive got stuck. Some help would be really good here. The controller has this code: def list @category_pages, @categories = paginate(:category, :per_page =>
2011 Aug 25
1
R hangs after htmlTreeParse
Dear colleagues, I'm trying to parse the html content from this webpage:
2006 May 23
1
Re: Wierd pagination problem - Unknown options:
> Unfortunately I still get the same error. Here is my code now (the > commented line works): > > def list > @upload_pages, @uploads = paginate(:uploads, :per_page => > 20, :order > => ''id'') > # @upload_pages, @uploads = paginate(:uploads, :per_page => 20) > end You may have an older version, try using the order_by clause
2005 Dec 31
3
Sort or Order a <Select> box.
Evening folks, I''m new to RoR, and have found some very useful info on this site, thanks. I have a select box that I need to sort. <select name="people[peoplekind_id]"> <% @peoplekinds.each do |peoplekind| %> <option value="<%= peoplekind.id %>" <%= '' selected'' if peoplekind.id == @people.peoplekind_id %>> <%=
2006 Mar 31
2
Silly question
Hi there, I know this is be a very minor issue, but considering @users = User.find :all, :order => ''name'' _AND_ @user_pages, @users = paginate :user, :order_by => ''name'' by simplicity, shouldn''t the symbols :order and :order_by be the same or both to both cases ? I stumbled on them a couple of times yet :) Thanks, Andre --
2006 Aug 07
4
Problem with Pagination
Hi Guys, I am trying to paginate the results from a search. When I use actual constants in the search conditions, it works fine: def query @k2_result_pages, @k2_results = paginate (:k2_results, :conditions => [''e_date >= ? AND e_date <= ?'', ''2006-07-12'', ''2006-08-12''],
2006 Feb 08
7
DRY methodology
because I am a grasshopper... Now that I can sort my ''list''...is there a logical way of not repeating myself to having essentially the same list view with multiple sorts? i.e. def list_cl # ordered by clients last name @placement_pages, @placements = paginate( :placements, :include => [:client], :order_by =>
2006 Jun 14
4
Using now() to determine what should be displayed
I''m trying to create a paginated list that will take note of the "end_date" field in my table. This is what I have: @post_pages, @posts = paginate(:posts, :per_page => 10, :order_by => ''end_date'') in the controller. And for the view: <h1>Posts ending soon</h1> <ul><% for post in @posts do %> <strong>Post Title:
2006 May 14
4
searching on foreing keys
Hey all, I''m using a simple search function. It''s working great except for foreign keys. I have one table pets (id,name,owner_id) and another table people(id,name) owner_id being a foreign key of pet pointing to people name. here it is on the pet controller: @paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id like
2006 Aug 02
3
newbie question, adding conditions to collection of sql objs
I have: @pictures=@c.pictures How do I add limit and order_by conditions. I have tried the following: @c.pictures.find_all(:limit=>5) @c.pictures, :limit=>5 @c.pictures :limit=>5 None of these work. -- Posted via http://www.ruby-forum.com/.
2006 Apr 26
2
two layers of has_many
Hi, There are many companies. Each company has many departments. Each department has many employees. The following find_by_sql method seems awful. What is the best way to get all the employees of a company? class Company < ActiveRecord::Base has_many :departments def employees Employee.find_by_sql("SELECT employees.* FROM companies, departments, employees
2018 Nov 26
2
Source locations missing when using xray-account
Hi all, I am trying to add XRay support to the IR produced by GHC. Getting the basics working is not too complicated after adding the right function attribute but any analysis shows the function names but not the locations of the functions. In particular, I run a program which has been instrumented as follows: XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1" ./llvm
2009 May 26
1
[PATCH server] fix for Bug 466731 - There is no title for the third column in User Access page and can't be sorted
Added column title and made it sortable. Signed-off-by: Scott Seago <sseago at redhat.com> --- src/app/models/pool.rb | 4 +++- src/app/views/user/_grid.rhtml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb index 0a63723..3c95684 100644 --- a/src/app/models/pool.rb +++ b/src/app/models/pool.rb @@ -57,7
2006 Jan 03
0
has_and_belongs_to_many include problem
hey, i have users who are in groups, and i have a search form, where i can search on group, user lastname, and user firstname. All this is also with pagination. these are my models class User < ActiveRecord::Base has_and_belongs_to_many :groups end class Group < ActiveRecord::Base has_and_belongs_to_many :users end in my controller i do this THIS works (but in need pagination) @users2
2006 Aug 17
8
Creating queries..
Hi, I 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
2006 Jun 08
9
find :order =>
Hi, I have the following find statment @client_pages, @clients = paginate :clients, :per_page => 20, :order => "organisation_id, surname" currently im ordering by organisation_id however I need to order by the field in the organisation table organisations.name how can this be done? Thanks Scott -- Posted via http://www.ruby-forum.com/.
2006 Aug 06
4
Can''t run rails
Yesterday, I was having a problem with db:migrate. I was told my version of rails was too old, and I needed to install it from gems instead of the version in my version of Ubuntu. Since then, I''ve done that, and I built ruby 1.8.4 from source and installed it. The installation was to /usr/local/bin. As my distribution had put ruby 1.8.3 in /usr/bin, I renamed that and put a link to
2005 Aug 09
0
how do I report the list order of a drag and drop list back?
Hello, I try to report the new order of a list back to the server, after the drag & drop is done, but I am not sure how to do it. My ids are underscore separated like this: <ul class="sortablelist" id="ja"> <li class="green" id="item_1">Item 1</li> ... </ul> I define the sortable like this: Sortable.create("ja",
2011 Sep 05
2
htmlParse hangs or crashes
Dear colleagues, each time I use htmlParse, R crashes or hangs. The url I'd like to parse is included below as is the results of a series of basic commands that describe what I'm experiencing. The results of sessionInfo() are attached at the bottom of the message. The thing is, htmlTreeParse appears to work just fine, although it doesn't appear to contain the information I need (the