# Rails

**URL:** https://www.ruby-forum.com/c/ruby-on-rails/6.md?page=979

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 980

---

## [Defining fixtures in Unit Tests necessary?](https://www.ruby-forum.com/t/defining-fixtures-in-unit-tests-necessary/163907)

<div class="topic-metadata">

**Author:** [@yachtman](https://www.ruby-forum.com/u/yachtman)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 2:44pm UTC](https://www.ruby-forum.com/t/defining-fixtures-in-unit-tests-necessary/163907 "2009-03-26T14:44:40Z")

</div>

Just sinking my teeth into tests and the going is tough. Is it necessary to define fixtures in my test file (‘fixtures :users’)? My test are working with the definition, but I decided to debug and checked for the fix…

---

## [Passenger 2.1.2 and mod\_rewrite](https://www.ruby-forum.com/t/passenger-2-1-2-and-mod-rewrite/163962)

<div class="topic-metadata">

**Author:** [@MichaSSSSSKalbarcz](https://www.ruby-forum.com/u/MichaSSSSSKalbarcz)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 2:38pm UTC](https://www.ruby-forum.com/t/passenger-2-1-2-and-mod-rewrite/163962 "2009-03-26T14:38:47Z")

</div>

Hey. Is anybody has working mod\_rewrite with passenger 2.1.2 ? Redirects work, but rewrites not. I have rewrite logging on, and it looks like ‘local path’ rewrites just fine, but rails can’t see it. Thanks. FaziBea…

---

## [RTF Creation Help](https://www.ruby-forum.com/t/rtf-creation-help/163950)

<div class="topic-metadata">

**Author:** [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 1:11pm UTC](https://www.ruby-forum.com/t/rtf-creation-help/163950 "2009-03-26T13:11:09Z")

</div>

Hi Everyone, Can anyone tell where to find samples of creating a RTF document in Rails? I am using “rtf-0.1.0.gem” and i have its API Doc too. But there are no examples in it for creating “Table” or “Images” in it. T…

---

## [Rmagick](https://www.ruby-forum.com/t/rmagick/163936)

<div class="topic-metadata">

**Author:** [@ponlork](https://www.ruby-forum.com/u/ponlork)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/rmagick/163936 "2009-03-26T13:01:09Z")

</div>

Hello, So i have some problem after i change rmagick to new version befor i used rmagick version 1.14.0 now i update to 2.9.0 when i eceute my code it error like this: — no decode delegate for this image format \`pub…

---

## [Prawn + PrawnTo + Rails 2.3.2](https://www.ruby-forum.com/t/prawn-prawnto-rails-2-3-2/163951)

<div class="topic-metadata">

**Author:** [@balajidl](https://www.ruby-forum.com/u/balajidl)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 1:00pm UTC](https://www.ruby-forum.com/t/prawn-prawnto-rails-2-3-2/163951 "2009-03-26T13:00:29Z")

</div>

Hi, Have anyone made a successful usage of Rails 2.3.3 with PrawnTo and Prawn ? I followed all the tutorials I could find on Net, but I am not able to see pdf part working. I kept getting the error “Template is miss…

---

## [Lightbox popup on ajax pages](https://www.ruby-forum.com/t/lightbox-popup-on-ajax-pages/163948)

<div class="topic-metadata">

**Author:** [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/lightbox-popup-on-ajax-pages/163948 "2009-03-26T12:59:59Z")

</div>

Hi, I’m using lightbox.js for displaying chromeless popup windows. I have a main page on which I have javascript\_include\_tag and stylesheet\_link\_tag to include lightbox. Calls to the lightbox popups from this main pa…

---

## [Send\_file using AJAX](https://www.ruby-forum.com/t/send-file-using-ajax/163927)

<div class="topic-metadata">

**Author:** [@sudhi](https://www.ruby-forum.com/u/sudhi)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/send-file-using-ajax/163927 "2009-03-26T12:54:40Z")

</div>

I have a AJAX based form and when I use send\_file there is no pop-up that appears to prompt user to download file… how do I fix this? Regards, Sudhindra

---

## [Upload column - Updating the image using upload\_column](https://www.ruby-forum.com/t/upload-column-updating-the-image-using-upload-column/163947)

<div class="topic-metadata">

**Author:** [@indu](https://www.ruby-forum.com/u/indu)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 12:41pm UTC](https://www.ruby-forum.com/t/upload-column-updating-the-image-using-upload-column/163947 "2009-03-26T12:41:14Z")

</div>

Hai I am using upload\_column for uploading images. Trying to do the user registration. For the first time when the user tries to upload image it works fine. But when try to update the image an error undefined method…

---

## [Rails-2.3.2 and ruby-1.9.1 have problems with utf-8 chars using script/runner](https://www.ruby-forum.com/t/rails-2-3-2-and-ruby-1-9-1-have-problems-with-utf-8-chars-using-script-runner/163945)

<div class="topic-metadata">

**Author:** [@freakout](https://www.ruby-forum.com/u/freakout)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 12:30pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-and-ruby-1-9-1-have-problems-with-utf-8-chars-using-script-runner/163945 "2009-03-26T12:30:34Z")

</div>

script/runner is called to deliver a mail by calling a ActionMailer deliver method: script/runner “Sitepost.deliver\_dailycalea(Site.find(1), Time.utc (2009,3,25)-246060)” gives: lib/commands/runner.rb:49:in eval': i…

---

## [Routing spec problem after updating to rSpec 1.2.2](https://www.ruby-forum.com/t/routing-spec-problem-after-updating-to-rspec-1-2-2/163789)

<div class="topic-metadata">

**Author:** [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 10:09am UTC](https://www.ruby-forum.com/t/routing-spec-problem-after-updating-to-rspec-1-2-2/163789 "2009-03-26T10:09:12Z")

</div>

Hi all, Before going forward with some sort of bug report to the rSpec guys I wanted to run this past you guys to make sure I’m not doing something stupid. I have this resource (this is actually from restful\_authenti…

---

## [Has\_and\_belongs\_to\_many relationship in nested forms](https://www.ruby-forum.com/t/has-and-belongs-to-many-relationship-in-nested-forms/163826)

<div class="topic-metadata">

**Author:** [@skiz](https://www.ruby-forum.com/u/skiz)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 7:53am UTC](https://www.ruby-forum.com/t/has-and-belongs-to-many-relationship-in-nested-forms/163826 "2009-03-26T07:53:22Z")

</div>

Hi, I have two models (say model a and b) that are joined using the has\_and\_belongs\_to\_many association. In model A I want to be able to link to model B in a form. But, when I create a nested\_form for model B I ha…

---

## [Unknown action - incorrect route](https://www.ruby-forum.com/t/unknown-action-incorrect-route/150533)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 7:13am UTC](https://www.ruby-forum.com/t/unknown-action-incorrect-route/150533 "2009-03-26T07:13:03Z")

</div>

I have a form called edit.rhtml that lets you edit attributes of an Event object. In the file I have the following code: \<% form\_tag :action =\> ‘update’, :id =\> @event do %\> \<%= render :partial =\> ‘form’ %\> \<%= subm…

---

## [Nil.errors and error\_messages\_for](https://www.ruby-forum.com/t/nil-errors-and-error-messages-for/163919)

<div class="topic-metadata">

**Author:** [@bongoman](https://www.ruby-forum.com/u/bongoman)\
**Replies:** 3\
**Last updated:** [March 26, 2009, 6:12am UTC](https://www.ruby-forum.com/t/nil-errors-and-error-messages-for/163919 "2009-03-26T06:12:49Z")

</div>

Hi there I’m wanting to re-render my index action in the event of an object not getting saved; I use render not redirect so as to preserve the validation errors. I’m using the error\_messages\_for helper in my view but…

---

## [Rails 2.2.2 - Mysql::Error: MySQL server has gone away](https://www.ruby-forum.com/t/rails-2-2-2-mysql-mysql-server-has-gone-away/161854)

<div class="topic-metadata">

**Author:** [@a2ahmad](https://www.ruby-forum.com/u/a2ahmad)\
**Replies:** 6\
**Last updated:** [March 26, 2009, 2:32am UTC](https://www.ruby-forum.com/t/rails-2-2-2-mysql-mysql-server-has-gone-away/161854 "2009-03-26T02:32:52Z")

</div>

My app consists of receiving emails with image attachments from its users so I have been employing the MMS2R gem and Fetcher. Every 60 seconds the app goes to the email server to fetch emails. Under Rails 2.1.1 things…

---

## [Form\_tag\_with\_upload\_progress with rails 2.x not updating its progress bar](https://www.ruby-forum.com/t/form-tag-with-upload-progress-with-rails-2-x-not-updating-its-progress-bar/163909)

<div class="topic-metadata">

**Author:** [@railzman](https://www.ruby-forum.com/u/railzman)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 2:19am UTC](https://www.ruby-forum.com/t/form-tag-with-upload-progress-with-rails-2-x-not-updating-its-progress-bar/163909 "2009-03-26T02:19:25Z")

</div>

Hello guys! I’ve just installed the upload\_progress plugin and followed the instructions but the progress bar does not get updated. When upload starts I can read “Upload starting…” just below the empty progress bar,…

---

## [Starling problem](https://www.ruby-forum.com/t/starling-problem/163905)

<div class="topic-metadata">

**Author:** [@florian](https://www.ruby-forum.com/u/florian)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 1:50am UTC](https://www.ruby-forum.com/t/starling-problem/163905 "2009-03-26T01:50:08Z")

</div>

Hi, installed starling on OS-X (starling (0.9.8), ruby 1.8.7 (2008-08-11 patchlevel 72)) , and am getting some weird exceptions when running it out of the box. Has anyone seen similar problems? Thanks, Florian irb(…

---

## [Does putting methods in Application.rb slow things down?](https://www.ruby-forum.com/t/does-putting-methods-in-application-rb-slow-things-down/163902)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 1\
**Last updated:** [March 25, 2009, 11:57pm UTC](https://www.ruby-forum.com/t/does-putting-methods-in-application-rb-slow-things-down/163902 "2009-03-25T23:57:45Z")

</div>

I’m wondering if including a method or a library or a stylesheet in Application.rb will slow things down for a controller that doesn’t use any of what is listed above?

---

## [Database Error?](https://www.ruby-forum.com/t/database-error/163879)

<div class="topic-metadata">

**Author:** [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Replies:** 9\
**Last updated:** [March 25, 2009, 11:51pm UTC](https://www.ruby-forum.com/t/database-error/163879 "2009-03-25T23:51:18Z")

</div>

Hello everyone, I am getting this database connection error when I run a rake task or when I try to send with ar\_mailer. My app works fine that I know of but I went to import users into the database and this is what …

---

## [Curious how params, flash etc work in rails?](https://www.ruby-forum.com/t/curious-how-params-flash-etc-work-in-rails/163887)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [March 25, 2009, 11:24pm UTC](https://www.ruby-forum.com/t/curious-how-params-flash-etc-work-in-rails/163887 "2009-03-25T23:24:20Z")

</div>

I am curious how stuff like params and flash work in the controller ? Typically an instance variable is something like @params, or maybe self.params. How does rails make params appear as if it’s an instance variable ? …

---

## [Ruby on Rails Developer](https://www.ruby-forum.com/t/ruby-on-rails-developer/163899)

<div class="topic-metadata">

**Author:** [@Shveta](https://www.ruby-forum.com/u/Shveta)\
**Replies:** 0\
**Last updated:** [March 25, 2009, 11:13pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-developer/163899 "2009-03-25T23:13:12Z")

</div>

ProKarma is a full service company offering IT Services & Solutions, IT Outsourcing Services, BPO Services, Utility Management, Procurement Management, and Software Products. We have a very Strong delivery capability…

---

## [Advanced search for a model (including keywords)](https://www.ruby-forum.com/t/advanced-search-for-a-model-including-keywords/163860)

<div class="topic-metadata">

**Author:** [@aupayo](https://www.ruby-forum.com/u/aupayo)\
**Replies:** 4\
**Last updated:** [March 25, 2009, 11:12pm UTC](https://www.ruby-forum.com/t/advanced-search-for-a-model-including-keywords/163860 "2009-03-25T23:12:37Z")

</div>

Hello, I am new in rails and I am working in an application which requires advanced search. I have a model called Item which has various attributes like “weight”, “price”, “category”, “age”…and then it has some “keyw…

---

## [MonkeyPatching ActiveRecord::Base class](https://www.ruby-forum.com/t/monkeypatching-activerecord-base-class/163694)

<div class="topic-metadata">

**Author:** [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Replies:** 12\
**Last updated:** [March 25, 2009, 10:55pm UTC](https://www.ruby-forum.com/t/monkeypatching-activerecord-base-class/163694 "2009-03-25T22:55:15Z")

</div>

I am trying to monkey-patch the ActiveRecord::Base class to incorporate a generic search class method so that it can be used by all model classes which need this functionality. Since model classes directly inherit fr…

---

## [Remote\_form\_for ajax validation](https://www.ruby-forum.com/t/remote-form-for-ajax-validation/162945)

<div class="topic-metadata">

**Author:** [@isaac](https://www.ruby-forum.com/u/isaac)\
**Replies:** 1\
**Last updated:** [March 25, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/remote-form-for-ajax-validation/162945 "2009-03-25T22:46:51Z")

</div>

Hi, I have been reading a lot about this, but I do not manage to do a nice validation. I already managed to save data to the database, to validate a field, to display a “Everything went well” message. I can also disp…

---

## [\[JOBS\] FOSS remote monitoring system is searching for Rails developers](https://www.ruby-forum.com/t/jobs-foss-remote-monitoring-system-is-searching-for-rails-developers/163889)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [March 25, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/jobs-foss-remote-monitoring-system-is-searching-for-rails-developers/163889 "2009-03-25T22:39:12Z")

</div>

Hey everybody, this is my second message regarding this topic to rubyonrails-talk. My first message is from last year. There has been a lot of progress since then so I am asking again: ScopePort is a free open source…

---

## [Question about creating a link to download](https://www.ruby-forum.com/t/question-about-creating-a-link-to-download/163880)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 6\
**Last updated:** [March 25, 2009, 9:54pm UTC](https://www.ruby-forum.com/t/question-about-creating-a-link-to-download/163880 "2009-03-25T21:54:41Z")

</div>

Hi Folks, I’m new to Rails and working on a project where after the user logs in they can click on a link to download an exe file ( say for example the file is at http://test.com/test.exe). I want to keep the link to …

---

## [Cannot set date value](https://www.ruby-forum.com/t/cannot-set-date-value/163684)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 8\
**Last updated:** [March 25, 2009, 9:33pm UTC](https://www.ruby-forum.com/t/cannot-set-date-value/163684 "2009-03-25T21:33:46Z")

</div>

I have this controller code: … field\_array.each do |f| f = f.to\_sym model.send("#{f}=", “#{parm\_hash\[f\]}”) if model.attribute\_present?(f) end return model … field\_array is an array of attribute names as strings. …

---

## [Can't update hidden attribute](https://www.ruby-forum.com/t/cant-update-hidden-attribute/163739)

<div class="topic-metadata">

**Author:** [@Sacredceltic](https://www.ruby-forum.com/u/Sacredceltic)\
**Replies:** 6\
**Last updated:** [March 25, 2009, 8:31pm UTC](https://www.ruby-forum.com/t/cant-update-hidden-attribute/163739 "2009-03-25T20:31:52Z")

</div>

Hi, I want to be able to determine the gender of a person by clicking on a picture (a boy and a girl’s face), and it doesn’t work. I can see the F or G appear on the screen (when I don’t want that actually because it…

---

## [More concise way to write aggregate query](https://www.ruby-forum.com/t/more-concise-way-to-write-aggregate-query/163856)

<div class="topic-metadata">

**Author:** [@Neal\_L](https://www.ruby-forum.com/u/Neal_L)\
**Replies:** 2\
**Last updated:** [March 25, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/more-concise-way-to-write-aggregate-query/163856 "2009-03-25T20:04:12Z")

</div>

Hi all, Just curious if anyone knows a cleaner way to write this query… def payments\_for(start\_on, end\_on) sum = 0 self.leases.each { |lse| sum += lse.payments.within(start\_on, end\_on).sum(:amount) } sum end Tha…

---

## [I18n + ActionMailer = conflict?](https://www.ruby-forum.com/t/i18n-actionmailer-conflict/163878)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 1\
**Last updated:** [March 25, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/i18n-actionmailer-conflict/163878 "2009-03-25T19:52:06Z")

</div>

Hi there, can anybody tell me why I get the error message: “undefined method ‘t’ for #Mailer:0xb6d501e0” … when I call the following Mailer? ================================= class Mailer \< ActionMailer::Base def s…

---

## [ActiveRecord: Nested :include erroneous behavior](https://www.ruby-forum.com/t/activerecord-nested-include-erroneous-behavior/163827)

<div class="topic-metadata">

**Author:** [@akshay\_r](https://www.ruby-forum.com/u/akshay_r)\
**Replies:** 11\
**Last updated:** [March 25, 2009, 7:51pm UTC](https://www.ruby-forum.com/t/activerecord-nested-include-erroneous-behavior/163827 "2009-03-25T19:51:49Z")

</div>

Hi, Found a simple example breaking on moving to 2.2 from 2.0. This example illustrates the usage of nested :include finder options. class Book \< ActiveRecord::Base has\_many :distributors end class Distributor \< Ac…

[Previous page](https://www.ruby-forum.com/c/ruby-on-rails/6.md?page=978)

[Next page](https://www.ruby-forum.com/c/ruby-on-rails/6.md?page=980)
