similar to: sorting issue

Displaying 20 results from an estimated 9000 matches similar to: "sorting issue"

2006 Feb 20
5
find(:all) vs find_all
I started with Ruby on Rails in the 0.13.x period, so I''m sure I missed out on a lot of history. There''s probably some good explanation for something I''ve been wondering about, but I haven''t seen it written down anywhere. Maybe someone can clue me in. I''ve always felt that one of the uglier APIs was the ActiveRecord::find() method. I call
2007 Dec 12
7
Release Retrospective
First off, congrats to everyone for getting Rails 2 released. A lot of work went into the release, and it''s good to see us reach this milestone. And now that the release dust has settled, I think it might be useful for us to have a retrospective and evaluate how the release went. I think the Ruby on Rails project has improved a lot this year, and this is another opportunity
2006 Feb 10
4
before_save gotcha
Is it will known and accepted that before_save triggers should return true? I didn''t notice this before but now I see it in the documentation. Here is what I''m doing in my model: def before_save if self.has_album? self.visible = self.album.visible? end end That results in the expected result when album.visible? is true - but not when it is false. To make it
2006 Mar 02
3
@session or session
Which is more appropriate? @session[] or session[]? Both seem to work. Is there a difference between which should be used in the controller vs. the view?
2006 Jan 09
6
What is AJAX?
What is AJAX? SteveT Steve Litt Author: * Universal Troubleshooting Process courseware * Troubleshooting Techniques of the Successful Technologist * Rapid Learning: Secret Weapon of the Successful Technologist Webmaster * Troubleshooters.Com * http://www.troubleshooters.com
2006 Mar 19
2
How to create a proper name for the diff for the RoR patch?
Hello, http://dev.rubyonrails.org/wiki suggests to: Create a patch with your changes: svn diff > my_properly_named_patch.diff but how this proper name looks like? olegf
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations? order = Order.new(:name => "My Order") order.line_items << LineItem.new(:product_id => 1, :quantity => 2) order.line_items << LineItem.new(:product_id => 2, :quantity => 5) order.save The above - which is by far the most elegant way of putting it - doesn''t work for me - the line_items
2006 Apr 26
4
Re: Rails AR/Oracle Unit Test: [4280] failed
The revised patch submitted on #4748 broke the build, I''m looking to sort out why. Also note that this auto-test email didn''t make it to rails-core because it was too big (every test failed, so the resulting email was huge). I''ll patch my auto-testing script to truncate the email to no larger than a few kb. Michael Schoen wrote: > "marcel" made
2006 Mar 22
2
Edge Rails (1.1.0 RC1) and Typo Trunk
I tried the current Typo trunk with Edge Rails (1.1.0 RC1) and ran into the following problems: 1) /public/../config/environment.rb:107: undefined method `enable_upload_progress'' for ActionController::Base:Class (NoMethodError). I commented this line out and installed the Upload Progress plugin and this problem _appears_ to have gone away. 2) The second problem I
2006 Jan 03
4
Would someone like to tell me why this code will not solve my problem? (it''s short)
I am building an invoicing system but cannot use the auto_increment field to determine the invoice number (because they are running 3 different companies off the one system. I need to find the last invoice number from any given company and then add 1 to it to get the next invoice number. BUT, there is a unique case on the very first invoice produced because there is no earlier invoice
2006 Feb 28
3
Object#id will be deprecated?
I didn''t get the memo on this :P members_controller.rb:12: warning: Object#id will be deprecated; use Object#object_id Line 12 is: @member = Member.find(@current_member.id) How _should_ I be writing that line? Thanks, Joe -- Posted via http://www.ruby-forum.com/.
2006 Jan 15
4
form inputs resetting on sumbit
I searched for forum for something about this but couldn''t find anything. For example I have this in my view: (you enter start/end dates from dropdowns, pick a category and a report is generated.) <%= start_form_tag :action => ''display_report'' %> From: <%= date_select ''report'', ''date1'' %> <br /> To: <%=
2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the method API to take a string param that is evaled in a lambda. http://dev.rubyonrails.org/changeset/6693 I much preferred the old API, since it''s simple enough to pass a lambda. Passing a string means the lambda is in the wrong scope and doesn''t have access to objects in the test case scope. For an
2006 Jan 11
6
RJS and layouts
Hi all, I''ve been using RJS more and more for my app and I have sorta run into a possible issue. My app has different user roles that require different layouts. So far, this has worked fine, but now that I''m using rjs more and more I''m finding that the two don''t really work together since I have to rails not to use a layout upon controller method
2006 Jan 05
4
testing file uploads
Hi all, I was wondering about the class used when rails receives file uploads. Sometimes it appears to be a File, and other times it is a StringIO. Also it has methods such as original_filename that don''t appear to belong to either of these classes. I ask because I''m trying to work out how to test my fil upload related models and controllers. Is there some standardised way of
2013 Nov 10
3
accepts_nested_attributes_for how, example
I have following tables with following models: users(id, role_id) *has_many :entries* categories(id, category_name) *has_many :entries* entries(id, category_id, user_id) *belongs_to :user, belongs_to :category, has_one :storage* storages(id, title, content, entry_id)* belongs_to :entry*, *has_one :vote* votes(id, count, storage_id) *belongs_to :storage* Now,
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 Feb 25
2
How do templates get access to controller variables?
This is probably more of a Ruby question than a Rails question. I''ve always wondered exactly how controller instance variables are being made accessible to the ERb code in the views. In the Agile Rails book on pages 38, there''s a sidebar at the top that hints at what''s going on: "Rails does some Ruby magic so that the instance variables of the controller
2006 Jan 18
6
next rails release?
when is the next release of rails expected to drop? i''m looking forward to the multiple habtm associations working correctly, among a bunch of other fixes... just curious! -A -- Posted via http://www.ruby-forum.com/.
2006 Jan 17
1
many-to-many with extra fields
I''m trying to work with a many-to-many relationship, but the join table needs to have a is_primary field. What is the best way to work with this (adding / changing primary / deleting)? I understand that the :through option in Edge Rails can handle this better, but I was just wondering if there was a good way to handle this with Rails 1.0. Thanks, Kyle