# Rails

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

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

---

## [Trouble with if statement in helper function](https://www.ruby-forum.com/t/trouble-with-if-statement-in-helper-function/139859)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 6\
**Last updated:** [June 8, 2008, 4:02pm UTC](https://www.ruby-forum.com/t/trouble-with-if-statement-in-helper-function/139859 "2008-06-08T16:02:40Z")

</div>

I have a helper function that returns a bunch of html but i’m having trouble with this if statement ret += current\_id.to\_s + '\<br\>' ret += root\_id.to\_s if current\_id == root\_id then ret += 'Total Time: ' + t…

---

## [Problem with Sending attachments](https://www.ruby-forum.com/t/problem-with-sending-attachments/139869)

<div class="topic-metadata">

**Author:** [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Replies:** 0\
**Last updated:** [June 8, 2008, 2:15pm UTC](https://www.ruby-forum.com/t/problem-with-sending-attachments/139869 "2008-06-08T14:15:27Z")

</div>

def send\_mail(person,textarea,subject,attachment\_id) recipients person.email1 cc person.email2 from "some email address" subject subject content\_type "text/html" body textarea unless attachment\_id.ni…

---

## [Instance variables in application layout](https://www.ruby-forum.com/t/instance-variables-in-application-layout/139858)

<div class="topic-metadata">

**Author:** [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Replies:** 3\
**Last updated:** [June 8, 2008, 2:03pm UTC](https://www.ruby-forum.com/t/instance-variables-in-application-layout/139858 "2008-06-08T14:03:57Z")

</div>

Hi I have an application layout, and in it there is a sidebar. What i want to do is put things like tags, newly registered users, recent comments, etc in the sidebar. I am not sure how to do this… What controller do…

---

## [Collection\_select question](https://www.ruby-forum.com/t/collection-select-question/139810)

<div class="topic-metadata">

**Author:** [@nuky](https://www.ruby-forum.com/u/nuky)\
**Replies:** 3\
**Last updated:** [June 8, 2008, 12:38pm UTC](https://www.ruby-forum.com/t/collection-select-question/139810 "2008-06-08T12:38:33Z")

</div>

Hello, I’m pretty new to Ruby on Rails (ROR) so I’m sorry if this is a silly thing to ask. I have tried looking at several tutorials online but most of them are for the earlier version of ROR and even the API is not …

---

## [Simple Routing Error](https://www.ruby-forum.com/t/simple-routing-error/136625)

<div class="topic-metadata">

**Author:** [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Replies:** 5\
**Last updated:** [June 8, 2008, 12:36pm UTC](https://www.ruby-forum.com/t/simple-routing-error/136625 "2008-06-08T12:36:11Z")

</div>

Routing Error No route matches “/user/register” with {:method=\>:get} The URL is http://localhost:3000/user/register Here is app/views/user/register.rhtml Register \<% form\_for :user do |form| %\> Enter Your Deta…

---

## [So I"m sure someone has come across this before...but how do you fix the gem\_original\_require probl](https://www.ruby-forum.com/t/so-i-m-sure-someone-has-come-across-this-before-but-how-do-you-fix-the-gem-original-require-probl/139832)

<div class="topic-metadata">

**Author:** [@ron](https://www.ruby-forum.com/u/ron)\
**Replies:** 3\
**Last updated:** [June 8, 2008, 12:36pm UTC](https://www.ruby-forum.com/t/so-i-m-sure-someone-has-come-across-this-before-but-how-do-you-fix-the-gem-original-require-probl/139832 "2008-06-08T12:36:11Z")

</div>

I get this when trying to install gems: /usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in \`gem\_original\_require’: no such file to load – rdoc/rdoc (LoadError) The trouble is, I also get it when trying to i…

---

## [Auto-Update Database At A Specific Time: Possible?](https://www.ruby-forum.com/t/auto-update-database-at-a-specific-time-possible/139850)

<div class="topic-metadata">

**Author:** [@lottario](https://www.ruby-forum.com/u/lottario)\
**Replies:** 1\
**Last updated:** [June 8, 2008, 9:40am UTC](https://www.ruby-forum.com/t/auto-update-database-at-a-specific-time-possible/139850 "2008-06-08T09:40:19Z")

</div>

Well, I’ve been looking around, and I can’t seem to find anything remotely close to what I want to do (maybe I’m looking in the wrong places?). What I need (or rather, will need, since my app isn’t at this point yet.…

---

## [Prevent Textile from escaping pre tag](https://www.ruby-forum.com/t/prevent-textile-from-escaping-pre-tag/139786)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 1\
**Last updated:** [June 8, 2008, 6:08am UTC](https://www.ruby-forum.com/t/prevent-textile-from-escaping-pre-tag/139786 "2008-06-08T06:08:53Z")

</div>

I am using acts\_as\_textiled to format blog entries stored in my db. I would like to include properly formated ruby code snippets in my entries using the pre tag to get the correct spacing. However, a pre tag causes te…

---

## [Executing rake tasks with cron](https://www.ruby-forum.com/t/executing-rake-tasks-with-cron/125969)

<div class="topic-metadata">

**Author:** [@stanislavb](https://www.ruby-forum.com/u/stanislavb)\
**Replies:** 11\
**Last updated:** [June 8, 2008, 4:57am UTC](https://www.ruby-forum.com/t/executing-rake-tasks-with-cron/125969 "2008-06-08T04:57:59Z")

</div>

Hi, I have a kind of problems with executing rake tasks as cron jobs. These problems began after upgrading to Rails 2.0.2. So, these are the errors that I have Cannot find gem for Rails ~\>2.0.2.0: Install the missing…

---

## [Fusion charts plugin?](https://www.ruby-forum.com/t/fusion-charts-plugin/139719)

<div class="topic-metadata">

**Author:** [@apie](https://www.ruby-forum.com/u/apie)\
**Replies:** 1\
**Last updated:** [June 8, 2008, 3:56am UTC](https://www.ruby-forum.com/t/fusion-charts-plugin/139719 "2008-06-08T03:56:37Z")

</div>

I have to develop a reporting component for an application. I would like to use fusion charts. Does anyone know if there is a handy fusion charts plugin out there? I couldn’t find one although I did find these 2 posts…

---

## [Backgroundrb vs Forking/Threading](https://www.ruby-forum.com/t/backgroundrb-vs-forking-threading/139597)

<div class="topic-metadata">

**Author:** [@Mozmonkey](https://www.ruby-forum.com/u/Mozmonkey)\
**Replies:** 10\
**Last updated:** [June 8, 2008, 2:12am UTC](https://www.ruby-forum.com/t/backgroundrb-vs-forking-threading/139597 "2008-06-08T02:12:54Z")

</div>

I know very little about forking the ruby process but am running into a problem where I need to move some processing to a background task. What’s the main differences (pros/cons) between using Backgroundrb or a Forkin…

---

## [RAILS\_ENV = "production" does not work](https://www.ruby-forum.com/t/rails-env-production-does-not-work/121976)

<div class="topic-metadata">

**Author:** [@subroutine](https://www.ruby-forum.com/u/subroutine)\
**Replies:** 5\
**Last updated:** [June 7, 2008, 11:53pm UTC](https://www.ruby-forum.com/t/rails-env-production-does-not-work/121976 "2008-06-07T23:53:01Z")

</div>

I recently deployed my application and it works fine except for one minor detail: I cannot change the environment from development to production. My environment.rb has the first line #1 ENV\[“RAILS\_ENV”\] = “productio…

---

## [How to load the database.yml file again during runtime?](https://www.ruby-forum.com/t/how-to-load-the-database-yml-file-again-during-runtime/139834)

<div class="topic-metadata">

**Author:** [@juantar](https://www.ruby-forum.com/u/juantar)\
**Replies:** 2\
**Last updated:** [June 7, 2008, 11:24pm UTC](https://www.ruby-forum.com/t/how-to-load-the-database-yml-file-again-during-runtime/139834 "2008-06-07T23:24:15Z")

</div>

Hi, I have an application that allows the user to make changes to the database.yml file so that he can connect to another database. However I have to manually restart the application to make the changes in database.ym…

---

## [Monit fails to start|stop mongrel\_rails](https://www.ruby-forum.com/t/monit-fails-to-start-stop-mongrel-rails/139801)

<div class="topic-metadata">

**Author:** [@jbb](https://www.ruby-forum.com/u/jbb)\
**Replies:** 1\
**Last updated:** [June 7, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/monit-fails-to-start-stop-mongrel-rails/139801 "2008-06-07T22:35:32Z")

</div>

I’m battling with Monit on Debian Etch and need some help. I’ve included the mongrel.monitrc file I’m using. If you issue the start program and stop program commands shown in that file from the command line, they wo…

---

## [Search problems with joining two models/tables](https://www.ruby-forum.com/t/search-problems-with-joining-two-models-tables/139828)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 5\
**Last updated:** [June 7, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/search-problems-with-joining-two-models-tables/139828 "2008-06-07T21:25:06Z")

</div>

Hi to all, I am having problems getting a search to work. I have a search form with one text field for search linking to missing\_children\_controller.rb. This text field gets the name of a child to find matches. What …

---

## [Can't install Rails 2.1](https://www.ruby-forum.com/t/cant-install-rails-2-1/139825)

<div class="topic-metadata">

**Author:** [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Replies:** 3\
**Last updated:** [June 7, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/cant-install-rails-2-1/139825 "2008-06-07T21:06:17Z")

</div>

I wanted to make use of the new Rails 2.1 features for my app. I have everything running and mostly tested in development, but I can’t get Rails 2.1 (from 2.0.2) installed on my test/staging environment. My test env…

---

## [Async db writes to logs](https://www.ruby-forum.com/t/async-db-writes-to-logs/139765)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 3\
**Last updated:** [June 7, 2008, 8:45pm UTC](https://www.ruby-forum.com/t/async-db-writes-to-logs/139765 "2008-06-07T20:45:03Z")

</div>

I am looking for the most direct approach to launching ansyncronous database writes. These would be one-way, fire & forget. I can tolerate the occasional lost message. Been doing a bunch of reading on async process fo…

---

## [Testing in Rails, uniquness of, length\_of... Completeness vs. productivity](https://www.ruby-forum.com/t/testing-in-rails-uniquness-of-length-of-completeness-vs-productivity/139659)

<div class="topic-metadata">

**Author:** [@sw0rdfish](https://www.ruby-forum.com/u/sw0rdfish)\
**Replies:** 10\
**Last updated:** [June 7, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/testing-in-rails-uniquness-of-length-of-completeness-vs-productivity/139659 "2008-06-07T20:20:53Z")

</div>

What is everyone’s feelings on this topic… I am totally onboard with testing, I feel it’s critical and the idea of Test Driven Development is growing on me,especailly after RailsConf… What I’m wondering is, how deep …

---

## [Help with :include on active record finds](https://www.ruby-forum.com/t/help-with-include-on-active-record-finds/139783)

<div class="topic-metadata">

**Author:** [@Sean\_OSHara](https://www.ruby-forum.com/u/Sean_OSHara)\
**Replies:** 6\
**Last updated:** [June 7, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/help-with-include-on-active-record-finds/139783 "2008-06-07T20:15:34Z")

</div>

Hi All, I am having trouble getting the :include option to work on my active record finds. They are not eager loading, adding the joins to the sql queries. Has anyone had this problem? Here is my query: @cart = Car…

---

## [DRY validates\_format\_of?](https://www.ruby-forum.com/t/dry-validates-format-of/139817)

<div class="topic-metadata">

**Author:** [@jc71229](https://www.ruby-forum.com/u/jc71229)\
**Replies:** 4\
**Last updated:** [June 7, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/dry-validates-format-of/139817 "2008-06-07T20:14:23Z")

</div>

In a model I have following validates\_format\_of. Is there an easy way to DRY this up? It seems to be rather repetitive. validates\_format\_of :expiration\_date, :with =\> /^\[0-9\]{4}\[-\]\[0-9\]{2}\[-\]\[0-9\]{2}$/ valid…

---

## [Db: migrate issue](https://www.ruby-forum.com/t/db-migrate-issue/139831)

<div class="topic-metadata">

**Author:** [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Replies:** 1\
**Last updated:** [June 7, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/db-migrate-issue/139831 "2008-06-07T20:14:23Z")

</div>

I am trying to create a user model. When I generate the script, rails creates all the files though the migrate file should be labeled 001\_create\_users.rb. Instead the file has the date followed by some other number …

---

## [\[ANN/ADV\] "Advancing With Rails", July 21-24, Edison NJ](https://www.ruby-forum.com/t/ann-adv-advancing-with-rails-july-21-24-edison-nj/139821)

<div class="topic-metadata">

**Author:** [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Replies:** 0\
**Last updated:** [June 7, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/ann-adv-advancing-with-rails-july-21-24-edison-nj/139821 "2008-06-07T17:32:08Z")

</div>

Hi everyone – I’m very pleased to announce the following upcoming training course: ADVANCING WITH RAILS July 21-24 Edison, NJ “Advancing With Rails” is a course for intermediate Rails programmers who want to get to t…

---

## [Bug report](https://www.ruby-forum.com/t/bug-report/139766)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 3\
**Last updated:** [June 7, 2008, 4:41pm UTC](https://www.ruby-forum.com/t/bug-report/139766 "2008-06-07T16:41:23Z")

</div>

I assume this is a bug with find :last? capella.ps.last =\> #\<Program id: 888, name: "Post-… deleted\_reason: nil\> # worked capella.ps.find :last ActiveRecord::RecordNotFound: Couldn’t find Program with ID=6329 AND …

---

## [How many mongrel servers to setup](https://www.ruby-forum.com/t/how-many-mongrel-servers-to-setup/139586)

<div class="topic-metadata">

**Author:** [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Replies:** 4\
**Last updated:** [June 7, 2008, 11:45am UTC](https://www.ruby-forum.com/t/how-many-mongrel-servers-to-setup/139586 "2008-06-07T11:45:04Z")

</div>

Is there a formula, data points etc that I can use to decide how many mongrel servers is the optimal/max for a mongrel cluster setup on a box? i.e what should I look for in terms of processing, load etc. Thanks.

---

## [Passing Query Strings in Sessions](https://www.ruby-forum.com/t/passing-query-strings-in-sessions/139694)

<div class="topic-metadata">

**Author:** [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Replies:** 4\
**Last updated:** [June 7, 2008, 11:41am UTC](https://www.ruby-forum.com/t/passing-query-strings-in-sessions/139694 "2008-06-07T11:41:33Z")

</div>

Hi, I would like to pass the query string from action to action. For example, the following will work in my Devices controller. session\[:query\_string\] = :all @devices = Device.find(session\[:query\_string\]) But I don…

---

## [Strange eager loading issues](https://www.ruby-forum.com/t/strange-eager-loading-issues/139754)

<div class="topic-metadata">

**Author:** [@Sean\_OSHara](https://www.ruby-forum.com/u/Sean_OSHara)\
**Replies:** 1\
**Last updated:** [June 7, 2008, 11:34am UTC](https://www.ruby-forum.com/t/strange-eager-loading-issues/139754 "2008-06-07T11:34:29Z")

</div>

Hi, I am having trouble with eager loading in my app. It used to work all the time, but since upgrading to rails 2.0.2, and now rails 2.1, it doesn’t work with many of my queries. For example, this find is loaded ea…

---

## [Eager loading association with condition](https://www.ruby-forum.com/t/eager-loading-association-with-condition/139790)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 1\
**Last updated:** [June 7, 2008, 11:12am UTC](https://www.ruby-forum.com/t/eager-loading-association-with-condition/139790 "2008-06-07T11:12:43Z")

</div>

Hi, To explain my problem, I’ll use the standard Post/author example. Suppose I have class Post \< ActiveRecord::Base belongs\_to :author end I am using following to fetch the posts and author info in a single query…

---

## [Ultrasphinx: Anonymous modules have no name to be referenced by](https://www.ruby-forum.com/t/ultrasphinx-anonymous-modules-have-no-name-to-be-referenced-by/132472)

<div class="topic-metadata">

**Author:** [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Replies:** 3\
**Last updated:** [June 7, 2008, 10:24am UTC](https://www.ruby-forum.com/t/ultrasphinx-anonymous-modules-have-no-name-to-be-referenced-by/132472 "2008-06-07T10:24:49Z")

</div>

I’m deploying an app to FreeBSD and when I run the ultrasphinx:configure rake task I get the output: Anonymous modules have no name to be referenced by vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_suppor…

---

## [What happened to "activerecord-sqlserver-adapter" gem?](https://www.ruby-forum.com/t/what-happened-to-activerecord-sqlserver-adapter-gem/139539)

<div class="topic-metadata">

**Author:** [@rubylicious](https://www.ruby-forum.com/u/rubylicious)\
**Replies:** 2\
**Last updated:** [June 7, 2008, 8:54am UTC](https://www.ruby-forum.com/t/what-happened-to-activerecord-sqlserver-adapter-gem/139539 "2008-06-07T08:54:48Z")

</div>

Anyone know what happened to that gem? I use that gem along with ADO.rb to connect to sqlserver databases and I’m trying to install the gem and can’t locate it. It doesn’t even appear in the list of gems on rubyforge…

---

## [How to parse and normalize U.S. phone number](https://www.ruby-forum.com/t/how-to-parse-and-normalize-u-s-phone-number/139805)

<div class="topic-metadata">

**Author:** [@nahabed](https://www.ruby-forum.com/u/nahabed)\
**Replies:** 2\
**Last updated:** [June 7, 2008, 7:52am UTC](https://www.ruby-forum.com/t/how-to-parse-and-normalize-u-s-phone-number/139805 "2008-06-07T07:52:41Z")

</div>

I have an app that asks a user to enter a 10 digit phone number… To make things easy for the user, the input field is a single text box. I’d like to turn whatever the user enters into xxx-xxx-xxxx whether they enter …

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

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