Ruby on Rails »
Update from Rails RC to Rails 3Mon, 30 Aug 2010 14:28:21 UT
If I have rails 3 RC (--pre) currently installed on Windows (I know I am using windows :( ) Do I need to uninstall Rails 3 pre-release before updating to Rails 3?
after_saved called twice -- how to fix?
Mon, 30 Aug 2010 14:30:29 UT
I have an after_save callback setup, but it's getting called twice. Per [link] , this is a known issue that won't be fixed. (In summary, rails doesn't convert required files to absolute paths, so files get
How to properly define constants in helpers?
Mon, 30 Aug 2010 14:44:59 UT
Let's say I have a helper module like this module ThingsHelper DEFAULT_OPTIONS = { ... }.freeze def my_helper(options = {}) options.reverse_merge!(DEFAULT _OPTIONS) ... end end Then, in development environment, I get .../app/helpers/things_helper. rb:2: warning: already initialized constant DEFAULT_OPTIONS
Re: Ruby 2.3.8 Doc
Mon, 30 Aug 2010 15:16:26 UT
[link] More readable than the official site too. Best,
tag in HTML 5 (was Re: [Rails] Re: assert_select for textvalue)
Mon, 30 Aug 2010 15:44:44 UT
Actually, it's back in in HTML5... [link] Everything old is new again. Chris
Help with test Rspec
Mon, 30 Aug 2010 15:51:29 UT
There is a model with the Category fields parent_id and name_category. Golf name_category should consist of two words separated by spaces, each of which begins with a capital letter, such as "Ruby On Rails". There's also a selector Category.by_parent_id (id). How can this problem to write tests?
Mysql2 Gem Issue
Mon, 30 Aug 2010 16:23:32 UT
Hi I am trying to migrate to Rails3 final release. I have the mysql2 - 0.2.3 gem installed. While installing the gem, i got two weired notices: Enclosing class/module 'mMysql2' for class Client not known Enclosing class/module 'mMysql2' for class Result not known Now on opening up the very first page (default public.html) i am
Validates numericality issue
Mon, 30 Aug 2010 17:01:10 UT
Hello everyone I have a problem in my app with the validation on numericality. The field should be all numbers, and if an user types for example "12345abc" into the field an error is raised and the data is not saved. But in the field where the error was raised it now says "12345", I want this field to be blank instead.
Instant Rails Ruby Component
Mon, 30 Aug 2010 17:07:21 UT
Hello, I would like to update Ruby in instant rails from 1.8.6 to 1.9.2, but it is not just simple to extract and replace into ruby folder because i loose all gems like actionmailer etc... also i can't replace only ruby.exe because i get errors when i want to use gem update, see i updated gem to 1.3.7 version from 1.0.1 and the only thing is to update
rails3 xss escaping
Mon, 30 Aug 2010 18:06:32 UT
Hi. Is there a way to disable the default xss escaping of everything in rails3? What's the proper way of doing string concatenations like below with rails3 if xss escaping can not be disabled: "something #{link_to('something else') if value == true}" -- M.
Counter cache not decrementing
Mon, 30 Aug 2010 19:02:38 UT
This is what I have belongs_to :user, :counter_cache => true belongs_to :vote_item, :counter_cache => true belongs_to :vote_topic, :counter_cache => true def vote_for(vid, vtid) Vote.create(:user_id => self.id, :vote_item_id => vid, :vote_topic_id => vtid) end
Rails 3.0 - Production Server Setup
Mon, 30 Aug 2010 18:48:57 UT
Hello all, I am incredibly excited about Rails 3.0 and we will be using it for some products in the very near future. The problem is, we are currently using Debian for our development/production environments and they don't have very good support for Rails 3.0 (yet). Now, I love Debian because it's incredibly stable, easy to use, tons
find_in_batches vs limit
Sat, 28 Aug 2010 21:18:47 UT
Is the :limit option in the regular find call effectively same as doing find_in_batches? or does doing something like the following loads "all" of the record and then returns only 5? find(:all, :conditions => ['age > ?', age], :limit => 5)
Alternative to merge_conditions in Rails 3
Sat, 28 Aug 2010 15:37:36 UT
merge_conditions seems to be gone from rails 3. Is there something in Rails 3 or Arel that would allow me to achieve the same thing, which is to merge various types of conditions (array, hash, etc)? I haven't spent much time with Arel, so I may be missing something obvious. Thanks
polymorphic associations
Sat, 28 Aug 2010 23:14:00 UT
Ok, I've been on this issue for several hours already. If someone with more RoR experience can help me out. It will be much appreciated. A small description of what I am trying to do. In the deal show view. I want to display comments for a particular deal. So far everything works, except that I am unable to list down the comments. I can submit
WHICH Hosting
Sun, 29 Aug 2010 07:24:30 UT
I'm hosting my website on Hostmonster.com, when my website was built on.php it was fast BUT now when I've changed it and I'm running Ruby on Rails it loads and refreshes toooooo sloooow, which is THE Best & Cheapest Hosting company for Ruby on Rails, someone?
[ANN] Troll - A Rails plugin for making webservice mocking easier
Sun, 29 Aug 2010 07:50:50 UT
Hi Folks, Troll trumps your existing ActiveResource mocking libraries like inbuilt HttpMock,Fakeweb or Webmock out of water. With Troll, ActiveResource mocking just works, some of its features: 1. Don't need to mock calls at Net::HTTP level (which webmock,fakeweb do). Really, we don't care what HTTP library ActiveResource uses,
Wrong class being returned in association
Sun, 29 Aug 2010 10:39:17 UT
I'm using Rails 3.0.0rc and have the following models: class User has_many :readings has_many :conversations, :through=>:readings end class Reading belongs_to :user belongs_to :conversation end class Conversation has_many :readings has_many :users, :through=>:readings end and this controller code:
Help with prev/next links
Sun, 29 Aug 2010 12:53:45 UT
I've written a Image Gallery app in rails. It contains photo albums, in which you can upload photos, then click on an individual photo to view it's larger size. When you bring up the larger size, I have previous and next buttons to go through the photos in the album. My problem is when navigating through photos via the next and previous buttons, it scrolls
match default verb
Sun, 29 Aug 2010 13:40:19 UT
The default verb for match is :any. This means for: match 'dog/bark(/:num)' => 'dogs#bark' # get 3 barks match 'dog/eat' => 'dogs#eat' # post breakfast someone could post on dog/bark with :louder or get on dog/eat with :breakfast. This is annoying and messy, and definitely not RESTful.



