# Rails

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

[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:** 695

---

## [Fastercsv and associated records](https://www.ruby-forum.com/t/fastercsv-and-associated-records/184684)

<div class="topic-metadata">

**Author:** [@harm](https://www.ruby-forum.com/u/harm)\
**Replies:** 4\
**Last updated:** [March 7, 2010, 9:40pm UTC](https://www.ruby-forum.com/t/fastercsv-and-associated-records/184684 "2010-03-07T21:40:14Z")

</div>

Hi, I try to import data with a rake-task from a csv-file into a model like: provider, which has\_many :rates and rate, which belong\_to: provider I do the following: namespace :db do desc “load data from csv” tas…

---

## [Namespaced controller question](https://www.ruby-forum.com/t/namespaced-controller-question/184710)

<div class="topic-metadata">

**Author:** [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Replies:** 4\
**Last updated:** [March 7, 2010, 8:59pm UTC](https://www.ruby-forum.com/t/namespaced-controller-question/184710 "2010-03-07T20:59:12Z")

</div>

I have a utility controller that has an action in it. Before I changed to namespaced controllers, I could access the action with: /utility/my\_action There are no resources associated with the controller, so I’m assumi…

---

## [Rails code coverage](https://www.ruby-forum.com/t/rails-code-coverage/184745)

<div class="topic-metadata">

**Author:** [@ely](https://www.ruby-forum.com/u/ely)\
**Replies:** 0\
**Last updated:** [March 7, 2010, 8:53pm UTC](https://www.ruby-forum.com/t/rails-code-coverage/184745 "2010-03-07T20:53:22Z")

</div>

Hello, I would like to know if there is any tool that can show code coverage when the application is running. (like “cover” in Erlang) Thanks

---

## [Fixnum problem](https://www.ruby-forum.com/t/fixnum-problem/184738)

<div class="topic-metadata">

**Author:** [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Replies:** 5\
**Last updated:** [March 7, 2010, 8:52pm UTC](https://www.ruby-forum.com/t/fixnum-problem/184738 "2010-03-07T20:52:12Z")

</div>

Sir can i know what is the meaning of the phrase ‘comparison of Fixnum with nil failed’ I want to pass two parameters to a method in a model file… bt wen i pass an integer then it gives the above error… Please help…

---

## [Modelling Question](https://www.ruby-forum.com/t/modelling-question/184629)

<div class="topic-metadata">

**Author:** [@acgreen](https://www.ruby-forum.com/u/acgreen)\
**Replies:** 10\
**Last updated:** [March 7, 2010, 8:08pm UTC](https://www.ruby-forum.com/t/modelling-question/184629 "2010-03-07T20:08:17Z")

</div>

Let’s say I have the following real life objects Books, Authors, Roles. A Book can have one or many Authors and an Author can have one or many Books. An Author can also have one or many roles associated with a book (…

---

## [Displaying Nested Objects](https://www.ruby-forum.com/t/displaying-nested-objects/184717)

<div class="topic-metadata">

**Author:** [@ObjectEvolution](https://www.ruby-forum.com/u/ObjectEvolution)\
**Replies:** 2\
**Last updated:** [March 7, 2010, 7:13pm UTC](https://www.ruby-forum.com/t/displaying-nested-objects/184717 "2010-03-07T19:13:17Z")

</div>

Hi, I’ve got a question regarding my models in my Rails app. Let’s say I have an object: User which has\_many: Thing1 and Thing1 has\_many: Thing2 and Thing2 has\_one: Thing3 When I go to display this in my templa…

---

## [Fixnum problem](https://www.ruby-forum.com/t/fixnum-problem/184739)

<div class="topic-metadata">

**Author:** [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Replies:** 0\
**Last updated:** [March 7, 2010, 7:05pm UTC](https://www.ruby-forum.com/t/fixnum-problem/184739 "2010-03-07T19:05:34Z")

</div>

Sir can i know what is the meaning of the phrase ‘comparison of Fixnum with nil failed’ I want to pass two parameters to a method in a model file… bt wen i pass an integer then it gives the above error… Please help…

---

## [Mocha expectation is affecting (bleeding) from one test to another](https://www.ruby-forum.com/t/mocha-expectation-is-affecting-bleeding-from-one-test-to-another/184712)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 2\
**Last updated:** [March 7, 2010, 6:34pm UTC](https://www.ruby-forum.com/t/mocha-expectation-is-affecting-bleeding-from-one-test-to-another/184712 "2010-03-07T18:34:03Z")

</div>

Mocha expectation is affecting (bleeding) from one test to another: In one test, I have: Friendship.expects(:is\_friend?).with(users\[1\], users\[3\]).returns(true) Then, in another test, which actually is listed before th…

---

## [\[Newbie\] ActiveRecord: Calculate maximum of calculated column](https://www.ruby-forum.com/t/newbie-activerecord-calculate-maximum-of-calculated-column/184736)

<div class="topic-metadata">

**Author:** [@fangheuschrecke](https://www.ruby-forum.com/u/fangheuschrecke)\
**Replies:** 1\
**Last updated:** [March 7, 2010, 6:11pm UTC](https://www.ruby-forum.com/t/newbie-activerecord-calculate-maximum-of-calculated-column/184736 "2010-03-07T18:11:48Z")

</div>

Hi there, I recently started learning Ruby on Rails. I decided to learn Rails by programming some kind of small statistic application where I can document the fuel consumption of my car - i.e. everytime I’m at the gas …

---

## [Where do you put helper functions for fixture generation?](https://www.ruby-forum.com/t/where-do-you-put-helper-functions-for-fixture-generation/184737)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 0\
**Last updated:** [March 7, 2010, 6:01pm UTC](https://www.ruby-forum.com/t/where-do-you-put-helper-functions-for-fixture-generation/184737 "2010-03-07T18:01:15Z")

</div>

I’m writing a fixture in test/fixtures/parrots\_model.yml, and I’m happily using ERB to flesh out my fixture. Suddenly, I realize that I need a helper function to call from my erb code, such as: polly: subtype: parak…

---

## [Render :inline in ActionMailer](https://www.ruby-forum.com/t/render-inline-in-actionmailer/184735)

<div class="topic-metadata">

**Author:** [@Thilo-Alexander\_Gin](https://www.ruby-forum.com/u/Thilo-Alexander_Gin)\
**Replies:** 0\
**Last updated:** [March 7, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/render-inline-in-actionmailer/184735 "2010-03-07T17:51:18Z")

</div>

Hello everyone, while attempting to figure out how to render an inline template as body of a mail message in an ActionMailer I am somewhat lost and hope that somebody on the list can point me into the right directio…

---

## [How to process collection\_select in controller?](https://www.ruby-forum.com/t/how-to-process-collection-select-in-controller/184393)

<div class="topic-metadata">

**Author:** [@Thilo-Alexander\_Gin](https://www.ruby-forum.com/u/Thilo-Alexander_Gin)\
**Replies:** 3\
**Last updated:** [March 7, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/how-to-process-collection-select-in-controller/184393 "2010-03-07T15:41:58Z")

</div>

Hello everyone, I am currently somewhat stuck figuring out an elegant solution to my following problem: Let’s say I have the following classes: class Event \< ActiveRecord::Base belongs\_to :reg\_template, :class\_name…

---

## [From PHP -\> ROR hosting, hosting customers mailboxes and managing server while migrating to all goo](https://www.ruby-forum.com/t/from-php-ror-hosting-hosting-customers-mailboxes-and-managing-server-while-migrating-to-all-goo/184727)

<div class="topic-metadata">

**Author:** [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Replies:** 0\
**Last updated:** [March 7, 2010, 3:23pm UTC](https://www.ruby-forum.com/t/from-php-ror-hosting-hosting-customers-mailboxes-and-managing-server-while-migrating-to-all-goo/184727 "2010-03-07T15:23:49Z")

</div>

Would like to ask some advice from you experts on php -\> ror hosting migration. Could you guys advice me on this? The memory costs on my regular php server to run ROR are way to high for me Think this could be an int…

---

## [SWFUpload - IE 8 - prototype.js - give "Object doesn't support this property or method"](https://www.ruby-forum.com/t/swfupload-ie-8-prototype-js-give-object-doesnt-support-this-property-or-method/184721)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 4\
**Last updated:** [March 7, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/swfupload-ie-8-prototype-js-give-object-doesnt-support-this-property-or-method/184721 "2010-03-07T13:39:04Z")

</div>

In Internet Explorer 8, I am getting the following error “Object doesn’t support this property or method” at line 4821 of prototype.js. The debugger stops at this line: var nodes = $ (element).getElementsByTagName(…

---

## [T0\_r0 from include, is it bad?](https://www.ruby-forum.com/t/t0-r0-from-include-is-it-bad/184701)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [March 7, 2010, 11:30am UTC](https://www.ruby-forum.com/t/t0-r0-from-include-is-it-bad/184701 "2010-03-07T11:30:36Z")

</div>

Hi, Some of my queries that have includes get generated with t0\_r0. Is it something to avoid?

---

## [Using i18n to translate a full page](https://www.ruby-forum.com/t/using-i18n-to-translate-a-full-page/184715)

<div class="topic-metadata">

**Author:** [@harishreddyreddy](https://www.ruby-forum.com/u/harishreddyreddy)\
**Replies:** 0\
**Last updated:** [March 7, 2010, 10:14am UTC](https://www.ruby-forum.com/t/using-i18n-to-translate-a-full-page/184715 "2010-03-07T10:14:48Z")

</div>

Hi All, The only way that I can think of, to translate a full page is to use locale files as below but it seems impractical and incorrect to include huge chunks of static content in locale files. Could someone sugges…

---

## [Collection\_select with has\_one association](https://www.ruby-forum.com/t/collection-select-with-has-one-association/184713)

<div class="topic-metadata">

**Author:** [@gregm](https://www.ruby-forum.com/u/gregm)\
**Replies:** 1\
**Last updated:** [March 7, 2010, 9:33am UTC](https://www.ruby-forum.com/t/collection-select-with-has-one-association/184713 "2010-03-07T09:33:15Z")

</div>

Hi, I try to create a select menu with all the city available in my shop form. I’ve been able to populate the select menu but the city\_id isn’t stored in the shop table. There must be an error in my view regarding th…

---

## [Raise Exception in Non Active Record Model](https://www.ruby-forum.com/t/raise-exception-in-non-active-record-model/184707)

<div class="topic-metadata">

**Author:** [@smarter](https://www.ruby-forum.com/u/smarter)\
**Replies:** 2\
**Last updated:** [March 7, 2010, 8:30am UTC](https://www.ruby-forum.com/t/raise-exception-in-non-active-record-model/184707 "2010-03-07T08:30:42Z")

</div>

Hi There: If I raise an exception in a Non Active Record Model object on call from Controller that extends from ApplicationController, what are the best ways to show it on the view side as an error? Thanks much.

---

## [Static HTML in XML Builder or otherwise; With Dynamic Sectio](https://www.ruby-forum.com/t/static-html-in-xml-builder-or-otherwise-with-dynamic-sectio/184589)

<div class="topic-metadata">

**Author:** [@smarter](https://www.ruby-forum.com/u/smarter)\
**Replies:** 3\
**Last updated:** [March 7, 2010, 8:01am UTC](https://www.ruby-forum.com/t/static-html-in-xml-builder-or-otherwise-with-dynamic-sectio/184589 "2010-03-07T08:01:24Z")

</div>

Best way to display HTML file as text or xml where some parts are dynamic? So we have a Static HTML file and some portions will be dynamically changed. The Idea is to render as text or xml simply. If we read this Te…

---

## [Weird install problems](https://www.ruby-forum.com/t/weird-install-problems/184695)

<div class="topic-metadata">

**Author:** [@blair](https://www.ruby-forum.com/u/blair)\
**Replies:** 1\
**Last updated:** [March 7, 2010, 1:21am UTC](https://www.ruby-forum.com/t/weird-install-problems/184695 "2010-03-07T01:21:26Z")

</div>

I am new to RoR, and I am just starting out, but I am having massive problems doing what should be a painless install. I am running a windows machine and I have ruby installed as well as gems. When I try to do the com…

---

## [\[slightly OT\] Grokking agile practices](https://www.ruby-forum.com/t/slightly-ot-grokking-agile-practices/184598)

<div class="topic-metadata">

**Author:** [@Phoenix\_R](https://www.ruby-forum.com/u/Phoenix_R)\
**Replies:** 3\
**Last updated:** [March 6, 2010, 10:46pm UTC](https://www.ruby-forum.com/t/slightly-ot-grokking-agile-practices/184598 "2010-03-06T22:46:31Z")

</div>

I’m somewhat of a newbie to agile practices, and I know the Rails community in general is pretty “up to speed” on agile methodologies, but if there’s a better place for me to ask this question, let me know, and forgiv…

---

## [Globalize1 migration path, scopes and namespaces](https://www.ruby-forum.com/t/globalize1-migration-path-scopes-and-namespaces/184690)

<div class="topic-metadata">

**Author:** [@JSSS\_rgen\_FeSSSSlme](https://www.ruby-forum.com/u/JSSS_rgen_FeSSSSlme)\
**Replies:** 2\
**Last updated:** [March 6, 2010, 9:41pm UTC](https://www.ruby-forum.com/t/globalize1-migration-path-scopes-and-namespaces/184690 "2010-03-06T21:41:32Z")

</div>

Hi, I am working on this plugin I am calling globalize\_bridge. It is meant to provide a seamless migration path for rails apps using Globalize (1) and utilizing the built in rails I18n mechanism. I am pretty much don…

---

## [Searching method](https://www.ruby-forum.com/t/searching-method/184689)

<div class="topic-metadata">

**Author:** [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Replies:** 0\
**Last updated:** [March 6, 2010, 7:36pm UTC](https://www.ruby-forum.com/t/searching-method/184689 "2010-03-06T19:36:58Z")

</div>

def search if params\[:q\] query = params\[:q\] # First find the user hits… @users = User.find\_by\_contents(query, :limit =\> :all) # …then the subhits. personals = Personal.find\_by\_contents(query, :limit =\> :all) #flas…

---

## [Is there any developer from Bangladesh here?](https://www.ruby-forum.com/t/is-there-any-developer-from-bangladesh-here/184686)

<div class="topic-metadata">

**Author:** [@Alimul\_Razi](https://www.ruby-forum.com/u/Alimul_Razi)\
**Replies:** 0\
**Last updated:** [March 6, 2010, 7:05pm UTC](https://www.ruby-forum.com/t/is-there-any-developer-from-bangladesh-here/184686 "2010-03-06T19:05:16Z")

</div>

Looking forward to meet Bangladeshi Ruby developers. Please response. I need 3 developers. Its argent.

---

## [\[JOBS\] Launch Interactive Media Needs a PM and 3 developers](https://www.ruby-forum.com/t/jobs-launch-interactive-media-needs-a-pm-and-3-developers/184687)

<div class="topic-metadata">

**Author:** [@Alimul\_Razi](https://www.ruby-forum.com/u/Alimul_Razi)\
**Replies:** 0\
**Last updated:** [March 6, 2010, 7:05pm UTC](https://www.ruby-forum.com/t/jobs-launch-interactive-media-needs-a-pm-and-3-developers/184687 "2010-03-06T19:05:16Z")

</div>

If you are staying in Bangladesh and you are a Ruby on Rails expert please reply to this email or contact here. Alimul Razi, Development Manager, Launch Interactive media, Mahakhali, Dhaka Mobile: 8801713377455 Em…

---

## [Trying to figure out if this is a helper or a controller or a partial?](https://www.ruby-forum.com/t/trying-to-figure-out-if-this-is-a-helper-or-a-controller-or-a-partial/184674)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 3\
**Last updated:** [March 6, 2010, 6:37pm UTC](https://www.ruby-forum.com/t/trying-to-figure-out-if-this-is-a-helper-or-a-controller-or-a-partial/184674 "2010-03-06T18:37:46Z")

</div>

I have an app that I am trying to generate out some GoogleMaps. The GoogleMaps aren’t the problem, I am tripping over the proper way to handle what I want to do. I have a DB for map markers. Path 1: When the user ma…

---

## [As\_json for arrays?](https://www.ruby-forum.com/t/as-json-for-arrays/184680)

<div class="topic-metadata">

**Author:** [@benol](https://www.ruby-forum.com/u/benol)\
**Replies:** 0\
**Last updated:** [March 6, 2010, 4:52pm UTC](https://www.ruby-forum.com/t/as-json-for-arrays/184680 "2010-03-06T16:52:26Z")

</div>

Hi. The file /rails/activesupport/lib/active\_support/json/encoders/enumerable.rb Has: class Array (…) def as\_json(options = nil) #:nodoc: self end end I want a as\_json method FooModel.all.as\_json(:only =\> \[…\]) …

---

## [Capistrano problem with mongrel\_cluster.yml](https://www.ruby-forum.com/t/capistrano-problem-with-mongrel-cluster-yml/184676)

<div class="topic-metadata">

**Author:** [@thegoatboy](https://www.ruby-forum.com/u/thegoatboy)\
**Replies:** 0\
**Last updated:** [March 6, 2010, 2:00pm UTC](https://www.ruby-forum.com/t/capistrano-problem-with-mongrel-cluster-yml/184676 "2010-03-06T14:00:05Z")

</div>

Hello there I am having a little trouble with capistrano. I have a rails app, which is running on my hosting server. it was set up originally using this tutorial: http://www.hostingrails.com/Capistrano-2-x-Deploying-…

---

## [Getting many to many polymorphic associations to work as advertised](https://www.ruby-forum.com/t/getting-many-to-many-polymorphic-associations-to-work-as-advertised/184672)

<div class="topic-metadata">

**Author:** [@tribalvibes](https://www.ruby-forum.com/u/tribalvibes)\
**Replies:** 0\
**Last updated:** [March 6, 2010, 11:42am UTC](https://www.ruby-forum.com/t/getting-many-to-many-polymorphic-associations-to-work-as-advertised/184672 "2010-03-06T11:42:50Z")

</div>

Could anyone please help? Getting exceptions trying to implement: module P class List \< ActiveRecord::Base has\_many :list\_items has\_many :items, :through =\> :list\_items has\_many :contacts, :source =\> :item, :through…

---

## [Restful-authentication plugin for rails3](https://www.ruby-forum.com/t/restful-authentication-plugin-for-rails3/184664)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 1\
**Last updated:** [March 6, 2010, 11:30am UTC](https://www.ruby-forum.com/t/restful-authentication-plugin-for-rails3/184664 "2010-03-06T11:30:17Z")

</div>

Hi, I just installed Restful-authentication plugin and tried rails g authenticated user sessions and got Could not find generator authenticated. What is the problem? Thanks

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

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