# Rails

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

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

---

## [Color coding table rows depending on an attribute](https://www.ruby-forum.com/t/color-coding-table-rows-depending-on-an-attribute/108956)

<div class="topic-metadata">

**Author:** [@ebrad](https://www.ruby-forum.com/u/ebrad)\
**Replies:** 5\
**Last updated:** [July 10, 2007, 10:02am UTC](https://www.ruby-forum.com/t/color-coding-table-rows-depending-on-an-attribute/108956 "2007-07-10T10:02:53Z")

</div>

I need to show a different background color depending on the type of comment posted. The type of comment is determined from a drop-down selection. I figured the simplest way would be to do something like I have belo…

---

## [Preventing newer versions from hosing rails apps](https://www.ruby-forum.com/t/preventing-newer-versions-from-hosing-rails-apps/108972)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [July 10, 2007, 9:36am UTC](https://www.ruby-forum.com/t/preventing-newer-versions-from-hosing-rails-apps/108972 "2007-07-10T09:36:47Z")

</div>

I am starting a new rails app and want to use ActiveResource. This requires that I use edge rails, so I froze it to edge. However, after this, the environment would not load, throwing a NoMethodError for “options” on …

---

## [Rails - MySQL Connection with sample application](https://www.ruby-forum.com/t/rails-mysql-connection-with-sample-application/108980)

<div class="topic-metadata">

**Author:** [@jacobnelson79](https://www.ruby-forum.com/u/jacobnelson79)\
**Replies:** 0\
**Last updated:** [July 10, 2007, 8:49am UTC](https://www.ruby-forum.com/t/rails-mysql-connection-with-sample-application/108980 "2007-07-10T08:49:52Z")

</div>

Step 1: Create a new project named “projectdb” by typing the command “rails projectdb”. Step 2: generate a controller by typing the command “script/generate controller projectdb” which will create a file named “proje…

---

## [MySQL - Rails Connection with sample application](https://www.ruby-forum.com/t/mysql-rails-connection-with-sample-application/186068)

<div class="topic-metadata">

**Author:** [@jacobnelson79](https://www.ruby-forum.com/u/jacobnelson79)\
**Replies:** 0\
**Last updated:** [July 10, 2007, 8:46am UTC](https://www.ruby-forum.com/t/mysql-rails-connection-with-sample-application/186068 "2007-07-10T08:46:07Z")

</div>

Step 1: Create a new project named “projectdb” by typing the command “rails projectdb”. Step 2: generate a controller by typing the command “script/generate controller projectdb” which will create a file named “proje…

---

## [Commands to set up project ( including model & controller)](https://www.ruby-forum.com/t/commands-to-set-up-project-including-model-controller/108978)

<div class="topic-metadata">

**Author:** [@unnikrishnanes](https://www.ruby-forum.com/u/unnikrishnanes)\
**Replies:** 0\
**Last updated:** [July 10, 2007, 7:41am UTC](https://www.ruby-forum.com/t/commands-to-set-up-project-including-model-controller/108978 "2007-07-10T07:41:14Z")

</div>

Create Project rails project\_name change directory to ‘project\_name’ project\_name\> ruby script/server create 3 Databases databasename\_development databasename\_test databasename\_production open database.yml in c…

---

## [Modify scope\_condition in a model using acts\_as\_list](https://www.ruby-forum.com/t/modify-scope-condition-in-a-model-using-acts-as-list/108973)

<div class="topic-metadata">

**Author:** [@luis](https://www.ruby-forum.com/u/luis)\
**Replies:** 1\
**Last updated:** [July 10, 2007, 7:31am UTC](https://www.ruby-forum.com/t/modify-scope-condition-in-a-model-using-acts-as-list/108973 "2007-07-10T07:31:36Z")

</div>

Does anyone know how to modify the generated scope\_condition method that acts\_as\_list generates? I need to change that method at different times during program execution, but have been unable to do so.

---

## [Array#zip](https://www.ruby-forum.com/t/array-zip/108963)

<div class="topic-metadata">

**Author:** [@kapslok](https://www.ruby-forum.com/u/kapslok)\
**Replies:** 4\
**Last updated:** [July 10, 2007, 6:12am UTC](https://www.ruby-forum.com/t/array-zip/108963 "2007-07-10T06:12:46Z")

</div>

I’m having a problem trying to wrap the zip method in a function. If I put the following into irb: \[1,2,3\].zip \[4,5,6\],\[7,8,9\],\[10,11,12\],\[13,14,15\] I get: =\> \[\[1, 4, 7, 10, 13\], \[2, 5, 8, 11, 14\], \[3, 6, 9, 12, 15\]\] …

---

## [Need to add XTHML class attribute, link\_to's html options?](https://www.ruby-forum.com/t/need-to-add-xthml-class-attribute-link-tos-html-options/108970)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [July 10, 2007, 6:03am UTC](https://www.ruby-forum.com/t/need-to-add-xthml-class-attribute-link-tos-html-options/108970 "2007-07-10T06:03:30Z")

</div>

I need to add a class attribute to the elements generated by link\_to for my CSS to style the links. How can I do that? \<%= link\_to “Artworks”, :controller =\> “artwork”, :action =\> “list” %\>

---

## [How can I call another controller's action (or better yet, h](https://www.ruby-forum.com/t/how-can-i-call-another-controllers-action-or-better-yet-h/108793)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 7\
**Last updated:** [July 10, 2007, 5:56am UTC](https://www.ruby-forum.com/t/how-can-i-call-another-controllers-action-or-better-yet-h/108793 "2007-07-10T05:56:29Z")

</div>

I’ve got an action that runs, and when it’s done I want the user to POST to another URL. However I don’t want to display a form that they need to submit. The two ideas I’ve had are to either call OtherController#crea…

---

## [FAQ updates](https://www.ruby-forum.com/t/faq-updates/108949)

<div class="topic-metadata">

**Author:** [@Faisal\_N\_Jawdat](https://www.ruby-forum.com/u/Faisal_N_Jawdat)\
**Replies:** 5\
**Last updated:** [July 10, 2007, 5:14am UTC](https://www.ruby-forum.com/t/faq-updates/108949 "2007-07-10T05:14:27Z")

</div>

I’ve thrown a bunch of updates at the FAQ, and brought some of the original questions up to date with current practice: http://www.faisal.com/docs/ror-list-faq.xhtml As always, feel free to send me comments, new quest…

---

## [Very strange activerecord behavior](https://www.ruby-forum.com/t/very-strange-activerecord-behavior/108900)

<div class="topic-metadata">

**Author:** [@gcnovus](https://www.ruby-forum.com/u/gcnovus)\
**Replies:** 7\
**Last updated:** [July 10, 2007, 4:27am UTC](https://www.ruby-forum.com/t/very-strange-activerecord-behavior/108900 "2007-07-10T04:27:22Z")

</div>

I have the following class: class Question \< ActiveRecord::Base table has quiz\_id, text, created\_at, updated\_at belongs\_to :quiz has\_many :options validates\_presence\_of :text validates\_length\_of :text,…

---

## [Joining/referencing tables](https://www.ruby-forum.com/t/joining-referencing-tables/108895)

<div class="topic-metadata">

**Author:** [@dark-omen](https://www.ruby-forum.com/u/dark-omen)\
**Replies:** 5\
**Last updated:** [July 10, 2007, 3:29am UTC](https://www.ruby-forum.com/t/joining-referencing-tables/108895 "2007-07-10T03:29:16Z")

</div>

I am wondering if any one could explain table relationships for me using rails. What I am trying to do requires the joining of a product and the comments for the product, with the user information of whom posted the c…

---

## [NoMethodError when using find\_by\_sql](https://www.ruby-forum.com/t/nomethoderror-when-using-find-by-sql/108897)

<div class="topic-metadata">

**Author:** [@simplydope](https://www.ruby-forum.com/u/simplydope)\
**Replies:** 3\
**Last updated:** [July 10, 2007, 2:52am UTC](https://www.ruby-forum.com/t/nomethoderror-when-using-find-by-sql/108897 "2007-07-10T02:52:25Z")

</div>

I’m try to verify users on login. Here is my code: def self.authenticate(username,password,account\_code) employee = self.find(:all, :select =\> “e.id, e.first\_name, e.last\_name, e.username, e.account\_id, e.department…

---

## [Problem requiring custom validation](https://www.ruby-forum.com/t/problem-requiring-custom-validation/108965)

<div class="topic-metadata">

**Author:** [@Cynthia\_K](https://www.ruby-forum.com/u/Cynthia_K)\
**Replies:** 0\
**Last updated:** [July 10, 2007, 2:00am UTC](https://www.ruby-forum.com/t/problem-requiring-custom-validation/108965 "2007-07-10T02:00:12Z")

</div>

I have occasion to validate email addresses in multiple models over projects, so I decided to start a custom validation library. Google led me to this write up that is essentially what I want - but with a different fo…

---

## [Dir.glob does not find ".project"](https://www.ruby-forum.com/t/dir-glob-does-not-find-project/108960)

<div class="topic-metadata">

**Author:** [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Replies:** 1\
**Last updated:** [July 10, 2007, 1:58am UTC](https://www.ruby-forum.com/t/dir-glob-does-not-find-project/108960 "2007-07-10T01:58:11Z")

</div>

Hi, I am trying to zip up my application folder using RubyZip. It works fine except for one glitch: There is a RadRails project file “.project” which does not get included. When I test Dir.glob("#{app\_dir}/\*\*/\*) it d…

---

## [Is Edge useable?](https://www.ruby-forum.com/t/is-edge-useable/108955)

<div class="topic-metadata">

**Author:** [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Replies:** 1\
**Last updated:** [July 10, 2007, 12:53am UTC](https://www.ruby-forum.com/t/is-edge-useable/108955 "2007-07-10T00:53:05Z")

</div>

I’ve been trying to begin working with Edge Rails but I’m having trouble with active\_resource not loading. I normally use v 1.2.3 but started a new project then called rake rails:freeze:edge. Then immediately ran take…

---

## [In\_place\_editor\_field](https://www.ruby-forum.com/t/in-place-editor-field/108925)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [July 9, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/in-place-editor-field/108925 "2007-07-09T23:47:21Z")

</div>

Im using the in\_place\_editor\_field helper to make certain fields easily editable and able to update the database on the spot. The problem is that all this stuff gets submitted to the database on one page in a form. On…

---

## [Boundary zip code search](https://www.ruby-forum.com/t/boundary-zip-code-search/108957)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 0\
**Last updated:** [July 9, 2007, 11:44pm UTC](https://www.ruby-forum.com/t/boundary-zip-code-search/108957 "2007-07-09T23:44:41Z")

</div>

Is there a service or library around (preferably free) that returns a list of boundary zip codes from a given zip code?

---

## [Script/runner inside BackgrounDRb worker](https://www.ruby-forum.com/t/script-runner-inside-backgroundrb-worker/108929)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 6\
**Last updated:** [July 9, 2007, 11:39pm UTC](https://www.ruby-forum.com/t/script-runner-inside-backgroundrb-worker/108929 "2007-07-09T23:39:58Z")

</div>

How can I do this? When I try “rake backgroundrb:start” now, I get this error: /usr/lib/ruby/1.8/rubygems/custom\_require.rb:27:in \`gem\_original\_require’: /home/joe/projects/edu/config/…/script/backgroundrb/…/…/config…

---

## [Check Parameter is Integer](https://www.ruby-forum.com/t/check-parameter-is-integer/108944)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 5\
**Last updated:** [July 9, 2007, 11:34pm UTC](https://www.ruby-forum.com/t/check-parameter-is-integer/108944 "2007-07-09T23:34:57Z")

</div>

Hiya, A simple problem I expect, but I cannot seem to find a simple way to do it. How can I check to see if a parameter is a number or not. Bear in mind it may be nil so I need to cope with that situation too. Thank…

---

## [Is there a way to get date\_select to "select" another date b](https://www.ruby-forum.com/t/is-there-a-way-to-get-date-select-to-select-another-date-b/108891)

<div class="topic-metadata">

**Author:** [@sharon](https://www.ruby-forum.com/u/sharon)\
**Replies:** 2\
**Last updated:** [July 9, 2007, 11:20pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-get-date-select-to-select-another-date-b/108891 "2007-07-09T23:20:56Z")

</div>

Is there a way to use date\_select in the form\_for helper and have the displayed date in the drop-down list be something besides “today”? I’m trying to get it to be “yesterday” without success. I also tried \<% d = Date…

---

## [Using a module within another module](https://www.ruby-forum.com/t/using-a-module-within-another-module/108851)

<div class="topic-metadata">

**Author:** [@juan](https://www.ruby-forum.com/u/juan)\
**Replies:** 2\
**Last updated:** [July 9, 2007, 11:14pm UTC](https://www.ruby-forum.com/t/using-a-module-within-another-module/108851 "2007-07-09T23:14:55Z")

</div>

Hi, I’m trying to use the module ActiveSupport::CoreExtensions::Time::Calculations in a helper module, but I get a nasty error. My module looks like this: require ‘rubygems’ gem ‘activesupport’ include ActiveSuppor…

---

## [System Commands in Web App](https://www.ruby-forum.com/t/system-commands-in-web-app/108943)

<div class="topic-metadata">

**Author:** [@rawn027](https://www.ruby-forum.com/u/rawn027)\
**Replies:** 1\
**Last updated:** [July 9, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/system-commands-in-web-app/108943 "2007-07-09T22:45:05Z")

</div>

How would I go about calling system commands in a web app? Does anyone have any source available that I can look at? Thanks!

---

## [Calling a Rails action from the command line](https://www.ruby-forum.com/t/calling-a-rails-action-from-the-command-line/108952)

<div class="topic-metadata">

**Author:** [@Effie](https://www.ruby-forum.com/u/Effie)\
**Replies:** 3\
**Last updated:** [July 9, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/calling-a-rails-action-from-the-command-line/108952 "2007-07-09T22:31:16Z")

</div>

Anyone knows how to call a Rails action from the command line? I have an action that would update the database. I can call it from a web browser: http://localhost:3000/radar/update\_radar I want to create a cron job t…

---

## [Problem installing the Globalize plugin](https://www.ruby-forum.com/t/problem-installing-the-globalize-plugin/108953)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [July 9, 2007, 10:19pm UTC](https://www.ruby-forum.com/t/problem-installing-the-globalize-plugin/108953 "2007-07-09T22:19:30Z")

</div>

I attempted to install the latest for-1.2 globalize plugin and when I start my script/server I get this error. Can somebody tell me what is going on? $ script/server =\> Booting WEBrick… /usr/lib/ruby/gems/1.8/gems/…

---

## [Is there a quicker way to find info of a new record?](https://www.ruby-forum.com/t/is-there-a-quicker-way-to-find-info-of-a-new-record/108942)

<div class="topic-metadata">

**Author:** [@rjsquire](https://www.ruby-forum.com/u/rjsquire)\
**Replies:** 1\
**Last updated:** [July 9, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/is-there-a-quicker-way-to-find-info-of-a-new-record/108942 "2007-07-09T21:59:48Z")

</div>

I have modified a basic function for creating a new record. def create @contact = Contact.new(params\[:contact\]) @contact.user\_id = current\_user.id @contact.save end I also have another table that holds records as t…

---

## [Nginx/Mongrel hanging requests](https://www.ruby-forum.com/t/nginx-mongrel-hanging-requests/108772)

<div class="topic-metadata">

**Author:** [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Replies:** 7\
**Last updated:** [July 9, 2007, 9:56pm UTC](https://www.ruby-forum.com/t/nginx-mongrel-hanging-requests/108772 "2007-07-09T21:56:51Z")

</div>

Hello guys. We have a strange issue with our rails app deployed on a linux box with a nginx in front and a mongrel cluster behind. Mostly the app runs straight, fast enough - everything is fine. But sometimes, a requ…

---

## [Multi-threaded database interaction](https://www.ruby-forum.com/t/multi-threaded-database-interaction/108766)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 2\
**Last updated:** [July 9, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/multi-threaded-database-interaction/108766 "2007-07-09T21:53:46Z")

</div>

Hello, I recently wrote a Rails app that launches 7 threads that each need to do ActiveRecord::Base.finds on a PostgreSQL database. I figured that since no database information is being changed on calls to find, these …

---

## [Scriptaculous - End Drag event exist?](https://www.ruby-forum.com/t/scriptaculous-end-drag-event-exist/108951)

<div class="topic-metadata">

**Author:** [@quantass](https://www.ruby-forum.com/u/quantass)\
**Replies:** 0\
**Last updated:** [July 9, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/scriptaculous-end-drag-event-exist/108951 "2007-07-09T21:32:48Z")

</div>

Im using Scriptaculous to perform sorting on my objects using: Sortable.create(). Im able to drag drop the item but i have because i have an onClick event for each item that is draggable, the click event is called onc…

---

## [Specifying a Form name using start\_/form\_tag](https://www.ruby-forum.com/t/specifying-a-form-name-using-start-form-tag/62708)

<div class="topic-metadata">

**Author:** [@Michael\_Xenakis](https://www.ruby-forum.com/u/Michael_Xenakis)\
**Replies:** 2\
**Last updated:** [July 9, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/specifying-a-form-name-using-start-form-tag/62708 "2007-07-09T21:29:43Z")

</div>

Hey all. I’m trying use the form tag(s) to create a named / id’d form. I.e., I need to use JS to access the form via the DOM and submit it - support for a reusable navigation component which will persist app state o…

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

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