# Rails

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

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

---

## [Rails3b3 tests: tons of warnings](https://www.ruby-forum.com/t/rails3b3-tests-tons-of-warnings/187000)

<div class="topic-metadata">

**Author:** [@olistik](https://www.ruby-forum.com/u/olistik)\
**Replies:** 0\
**Last updated:** [April 15, 2010, 1:49pm UTC](https://www.ruby-forum.com/t/rails3b3-tests-tons-of-warnings/187000 "2010-04-15T13:49:16Z")

</div>

Hello everybody, I’ve just tried to run the test suite of rails 3 beta 3 but I get a lot of warnings: rails3b3\_tests\_warnings · GitHub This is my rvm info: gist:367001 · GitHub Note that this is a fresh installation o…

---

## [Readonly attributes](https://www.ruby-forum.com/t/readonly-attributes/186992)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 0\
**Last updated:** [April 15, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/readonly-attributes/186992 "2010-04-15T12:05:03Z")

</div>

In Firebird database one can declare computed columns. These columns are readonly in the database. How do I stop activerecord to include these columns in insert statements. I know about attr\_readonly for updates.

---

## [Order\_by From another Model Field](https://www.ruby-forum.com/t/order-by-from-another-model-field/186985)

<div class="topic-metadata">

**Author:** [@ashu](https://www.ruby-forum.com/u/ashu)\
**Replies:** 4\
**Last updated:** [April 15, 2010, 10:37am UTC](https://www.ruby-forum.com/t/order-by-from-another-model-field/186985 "2010-04-15T10:37:16Z")

</div>

trying to order\_by From another Model Field if params\[:order\_by\] == ‘name’ @object = Object.paginate(:all, :page =\> self.page\_number, :per\_page =\> 50, :order =\> “#{params\[:order\_by\]}”) elsif params\[:order\_by\] == ‘las…

---

## [\[Rails v3\] time\_zone\_select :priority\_zones not working properly](https://www.ruby-forum.com/t/rails-v3-time-zone-select-priority-zones-not-working-properly/186990)

<div class="topic-metadata">

**Author:** [@anthonys](https://www.ruby-forum.com/u/anthonys)\
**Replies:** 0\
**Last updated:** [April 15, 2010, 10:35am UTC](https://www.ruby-forum.com/t/rails-v3-time-zone-select-priority-zones-not-working-properly/186990 "2010-04-15T10:35:31Z")

</div>

When using :priority\_zones for time\_zone\_select in a manner described by the API docs for ActionView::Helpers::FormOptionsHelper I’m getting errors. Here is an API docs example: time\_zone\_select( “user”, ‘time\_zone’,…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/186989)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 15, 2010, 10:02am UTC](https://www.ruby-forum.com/t/no-subject/186989 "2010-04-15T10:02:44Z")

</div>

http://www.AndraWhy2135.co.cc

---

## [Render :update just displays code from JavaScriptGenerator](https://www.ruby-forum.com/t/render-update-just-displays-code-from-javascriptgenerator/186967)

<div class="topic-metadata">

**Author:** [@mstoth](https://www.ruby-forum.com/u/mstoth)\
**Replies:** 2\
**Last updated:** [April 15, 2010, 9:34am UTC](https://www.ruby-forum.com/t/render-update-just-displays-code-from-javascriptgenerator/186967 "2010-04-15T09:34:37Z")

</div>

I have looked around and seen similar problems but have not yet found a solution to this. Relatively new to RoR, I am trying to use render :update to modify the displayed page in the browser. No matter what I put in …

---

## [Need a feed aggregator](https://www.ruby-forum.com/t/need-a-feed-aggregator/186984)

<div class="topic-metadata">

**Author:** [@rahul\_m](https://www.ruby-forum.com/u/rahul_m)\
**Replies:** 0\
**Last updated:** [April 15, 2010, 8:44am UTC](https://www.ruby-forum.com/t/need-a-feed-aggregator/186984 "2010-04-15T08:44:51Z")

</div>

Idea behind this site is to aggregate interesting blogs / discussions related to software testing field and keep it at one place. Have a look at the http://www.testingreflections.com/ , this site pretty much provides…

---

## [Ror noob need help with easy hidden\_field question](https://www.ruby-forum.com/t/ror-noob-need-help-with-easy-hidden-field-question/186820)

<div class="topic-metadata">

**Author:** [@siouxsioux](https://www.ruby-forum.com/u/siouxsioux)\
**Replies:** 4\
**Last updated:** [April 15, 2010, 7:34am UTC](https://www.ruby-forum.com/t/ror-noob-need-help-with-easy-hidden-field-question/186820 "2010-04-15T07:34:38Z")

</div>

I’m trying to save users the trouble of creating a username, so I am generating it based on their email address. It doesn’t need to be unique, it is used in the view only, but that’s not my question. My question is h…

---

## [Test database and migrations](https://www.ruby-forum.com/t/test-database-and-migrations/197128)

<div class="topic-metadata">

**Author:** [@grar](https://www.ruby-forum.com/u/grar)\
**Replies:** 4\
**Last updated:** [April 15, 2010, 7:31am UTC](https://www.ruby-forum.com/t/test-database-and-migrations/197128 "2010-04-15T07:31:37Z")

</div>

Hi, I’d like to have the results of a migration file that prepopulates my development database available for testing. So, right now, after the usual rake migration, I can access my prepopulated data via script/ conso…

---

## [Display the RETURN key as a new line?](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897)

<div class="topic-metadata">

**Author:** [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Replies:** 4\
**Last updated:** [April 15, 2010, 7:27am UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897 "2010-04-15T07:27:55Z")

</div>

In a form field, if i user decides to hit enter to start new lines, when they submit, they new lines don’t start as new lines. There is a whole stream of text. How do i make it so if the user hits enter during a text …

---

## [Linux/Unix DNS question](https://www.ruby-forum.com/t/linux-unix-dns-question/186971)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 2\
**Last updated:** [April 15, 2010, 6:47am UTC](https://www.ruby-forum.com/t/linux-unix-dns-question/186971 "2010-04-15T06:47:13Z")

</div>

While traveling, I found a motel with WiFi where Firefox and the DNS utilities, nslookup and dig, worked as expected, but wget, termtter (a CLI Twitter client), my Ruby on Rails applications, and several other program…

---

## [Page caching when name contains a dot (period)](https://www.ruby-forum.com/t/page-caching-when-name-contains-a-dot-period/102035)

<div class="topic-metadata">

**Author:** [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Replies:** 1\
**Last updated:** [April 15, 2010, 3:21am UTC](https://www.ruby-forum.com/t/page-caching-when-name-contains-a-dot-period/102035 "2010-04-15T03:21:16Z")

</div>

Hi Everyone, Just thought I’d post some details of an interesting little quirk I’ve found with page caching. For a site I’ve just built for a small music festival, there are a number of artist profiles. I’m storin…

---

## [Why am I getting an extra SELECT before save!?](https://www.ruby-forum.com/t/why-am-i-getting-an-extra-select-before-save/186962)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 5\
**Last updated:** [April 15, 2010, 1:06am UTC](https://www.ruby-forum.com/t/why-am-i-getting-an-extra-select-before-save/186962 "2010-04-15T01:06:55Z")

</div>

In my app, I want to create a new record if it doesn’t exist, and update some fields if it does. Looking at the debug log, and it appears that I’m doing something that’s causing an extra SELECT. The basic synopsis: s…

---

## [How do I initialise](https://www.ruby-forum.com/t/how-do-i-initialise/186404)

<div class="topic-metadata">

**Author:** [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Replies:** 2\
**Last updated:** [April 14, 2010, 11:39pm UTC](https://www.ruby-forum.com/t/how-do-i-initialise/186404 "2010-04-14T23:39:21Z")

</div>

Hi, I’m playing around with module instance variables. I can set one up and initialise it when the module is included in a class. What I can’t work out is how I initialise one when a class inherits another class that …

---

## [Fastcgi + rails under plesk](https://www.ruby-forum.com/t/fastcgi-rails-under-plesk/186923)

<div class="topic-metadata">

**Author:** [@Sebastien\_Penet](https://www.ruby-forum.com/u/Sebastien_Penet)\
**Replies:** 1\
**Last updated:** [April 14, 2010, 11:17pm UTC](https://www.ruby-forum.com/t/fastcgi-rails-under-plesk/186923 "2010-04-14T23:17:04Z")

</div>

Hello, I have plesk 9.3 and I am trying to make it go along with rails. So I installed ruby, rails, ruby-gems, fastcgi, etc. (I had tried Passenger, but it didn’t work with my distro due to dependencies… so I prefer…

---

## [Alternate primary key for legacy data](https://www.ruby-forum.com/t/alternate-primary-key-for-legacy-data/186948)

<div class="topic-metadata">

**Author:** [@ben-v](https://www.ruby-forum.com/u/ben-v)\
**Replies:** 1\
**Last updated:** [April 14, 2010, 11:07pm UTC](https://www.ruby-forum.com/t/alternate-primary-key-for-legacy-data/186948 "2010-04-14T23:07:06Z")

</div>

I have a “journals” table (created with a rails migration but with “id” renamed to “id\_journal”) with auto-incrementing primary key “id\_journal”. class Journal \< ActiveRecord::Base set\_primary\_key “id\_journal” end D…

---

## [PGError: duplicate key](https://www.ruby-forum.com/t/pgerror-duplicate-key/186951)

<div class="topic-metadata">

**Author:** [@ricklach](https://www.ruby-forum.com/u/ricklach)\
**Replies:** 3\
**Last updated:** [April 14, 2010, 11:02pm UTC](https://www.ruby-forum.com/t/pgerror-duplicate-key/186951 "2010-04-14T23:02:25Z")

</div>

I’m running a rails 2.3.5 / ruby 1.8.7 / postgresql 8.4.2 app and have just run into a curious problem. I have several tables that are initialized with data from csv files and I’ve noticed that, when I try to add new …

---

## [Nested routes error](https://www.ruby-forum.com/t/nested-routes-error/186945)

<div class="topic-metadata">

**Author:** [@rpm](https://www.ruby-forum.com/u/rpm)\
**Replies:** 0\
**Last updated:** [April 14, 2010, 7:37pm UTC](https://www.ruby-forum.com/t/nested-routes-error/186945 "2010-04-14T19:37:09Z")

</div>

Hello everyone, I have a problem using nested routes when creating a nested object. I use map.resource :simulation\_process, :has\_many =\> :simulations Everything works fine except with this \<% form\_for \[@simulation\_…

---

## [Validating an individual field (Rails 3)](https://www.ruby-forum.com/t/validating-an-individual-field-rails-3/186896)

<div class="topic-metadata">

**Author:** [@cult\_hero](https://www.ruby-forum.com/u/cult_hero)\
**Replies:** 2\
**Last updated:** [April 14, 2010, 6:17pm UTC](https://www.ruby-forum.com/t/validating-an-individual-field-rails-3/186896 "2010-04-14T18:17:52Z")

</div>

I’m working on a form using a model that isn’t tied to a database or ORM at all and using ActiveModel::Validations works like a charm. I’m very pleased with it thus far. However, I can’t find an obvious way to validat…

---

## [Rails validations app specific problems](https://www.ruby-forum.com/t/rails-validations-app-specific-problems/186944)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 1\
**Last updated:** [April 14, 2010, 6:00pm UTC](https://www.ruby-forum.com/t/rails-validations-app-specific-problems/186944 "2010-04-14T18:00:18Z")

</div>

Hi all, I have a unique workflow where it’s making the use of validations difficult. My app is for internal use in my company and I have a funky implementation (inspired by the e-commerce Railscasts episodes) of a c…

---

## [Rake task dependency question](https://www.ruby-forum.com/t/rake-task-dependency-question/186943)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 0\
**Last updated:** [April 14, 2010, 5:37pm UTC](https://www.ruby-forum.com/t/rake-task-dependency-question/186943 "2010-04-14T17:37:14Z")

</div>

This is probably really simple: I want a new rake task to collect all the steps that we need to do to reset the state after changing branches. The steps needed can be done at the command line as follows: rake db:reset…

---

## [Rails does not display form error message on a custom method](https://www.ruby-forum.com/t/rails-does-not-display-form-error-message-on-a-custom-method/186937)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 1\
**Last updated:** [April 14, 2010, 4:52pm UTC](https://www.ruby-forum.com/t/rails-does-not-display-form-error-message-on-a-custom-method/186937 "2010-04-14T16:52:32Z")

</div>

Hi all, I’ve created a custom method called checkout in my app. I create an order (which is done my adding products to my “cart”), assign it to my client, and then I head to my checkout screen where I confirm the item…

---

## [Question about named route](https://www.ruby-forum.com/t/question-about-named-route/186917)

<div class="topic-metadata">

**Author:** [@makoto\_kuwata](https://www.ruby-forum.com/u/makoto_kuwata)\
**Replies:** 4\
**Last updated:** [April 14, 2010, 4:47pm UTC](https://www.ruby-forum.com/t/question-about-named-route/186917 "2010-04-14T16:47:06Z")

</div>

Hi, I have quetion about ‘named route’. I defined the following in routes.rb to use ‘:title’ instead of ‘:id’. map.movie ‘/ movies/:title’, :controller=\>‘movies’, :action=\>‘show’, :conditions=\>{:method=\>:get} This …

---

## [Module/class question](https://www.ruby-forum.com/t/module-class-question/186905)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 4\
**Last updated:** [April 14, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/module-class-question/186905 "2010-04-14T16:35:23Z")

</div>

Are these two below the same thing? module X module Y class Z class X::Y::Z

---

## [Rails 3 (beta3) and paths in the console](https://www.ruby-forum.com/t/rails-3-beta3-and-paths-in-the-console/186933)

<div class="topic-metadata">

**Author:** [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Replies:** 0\
**Last updated:** [April 14, 2010, 3:55pm UTC](https://www.ruby-forum.com/t/rails-3-beta3-and-paths-in-the-console/186933 "2010-04-14T15:55:46Z")

</div>

Did I miss some release note somewhere? I used to be able to, from the Rails console, get paths and urls using: app.posts\_path or app.post\_path§ Now, trying to do that, I get an error stating that those methods are p…

---

## [Connecting multiple databases - has\_many fails](https://www.ruby-forum.com/t/connecting-multiple-databases-has-many-fails/186910)

<div class="topic-metadata">

**Author:** [@pakothawade](https://www.ruby-forum.com/u/pakothawade)\
**Replies:** 5\
**Last updated:** [April 14, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/connecting-multiple-databases-has-many-fails/186910 "2010-04-14T15:46:47Z")

</div>

Has anyone faced this problem before? I have 3 models, Project, ProjectRole and User. The tables are distributed in two databases. Databases: Database X: users Database Y: projects project\_roles Models: class P…

---

## [Query string encryption](https://www.ruby-forum.com/t/query-string-encryption/186929)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 0\
**Last updated:** [April 14, 2010, 2:51pm UTC](https://www.ruby-forum.com/t/query-string-encryption/186929 "2010-04-14T14:51:07Z")

</div>

Hello, I’m using crypt/rijndael to encrypt data being sent through an HTTP POST. Before I send my encrypted string this is what I do: rijndael = Crypt::Rijndael.new(key) crypt = rijndael.encrypt\_string(“test”) esca…

---

## [Order by variable field name](https://www.ruby-forum.com/t/order-by-variable-field-name/186926)

<div class="topic-metadata">

**Author:** [@ashu](https://www.ruby-forum.com/u/ashu)\
**Replies:** 3\
**Last updated:** [April 14, 2010, 2:20pm UTC](https://www.ruby-forum.com/t/order-by-variable-field-name/186926 "2010-04-14T14:20:42Z")

</div>

What i have Age name Sex what i did \<%= link\_to ‘Age’,:order\_by =\> ‘age’, :action =\> ‘index’%\> \<%= link\_to ‘name’,:order\_by =\> ‘name’, :action =\> ‘index’%\> \<%= link\_to ‘Sex’,:order\_by =\> ‘Sex’, :action =\> ‘ind…

---

## [\[Rails 2.3\] Adding a "phase" to the ActiveRecord Lifecycle](https://www.ruby-forum.com/t/rails-2-3-adding-a-phase-to-the-activerecord-lifecycle/186895)

<div class="topic-metadata">

**Author:** [@Phoenix\_R](https://www.ruby-forum.com/u/Phoenix_R)\
**Replies:** 1\
**Last updated:** [April 14, 2010, 2:16pm UTC](https://www.ruby-forum.com/t/rails-2-3-adding-a-phase-to-the-activerecord-lifecycle/186895 "2010-04-14T14:16:36Z")

</div>

I’ve run into a situation where it seems to me that if I could “extend” the typical AR lifecycle to add another “phase” or step to it, it would simplify things. My problem is that I just don’t know how to do that, an…

---

## [Model question](https://www.ruby-forum.com/t/model-question/186925)

<div class="topic-metadata">

**Author:** [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Replies:** 2\
**Last updated:** [April 14, 2010, 1:33pm UTC](https://www.ruby-forum.com/t/model-question/186925 "2010-04-14T13:33:52Z")

</div>

I’m pondering a way of representing a scenario without too much fiddling with the database. I’m 90% happy with it, but have one problem (where I probably just don’t know the right AR approach to use). I have a “peopl…

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

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