# Rails

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

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

---

## [Instance variable life span in controller](https://www.ruby-forum.com/t/instance-variable-life-span-in-controller/172180)

<div class="topic-metadata">

**Author:** [@boblu](https://www.ruby-forum.com/u/boblu)\
**Replies:** 3\
**Last updated:** [July 16, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/instance-variable-life-span-in-controller/172180 "2009-07-16T12:59:43Z")

</div>

I understand that rails drops all instance variables created in normal controller action after rendering view templates. But I have the following problem that a normal controller action has several before\_filter and a…

---

## [Small problem in RoR Webservices](https://www.ruby-forum.com/t/small-problem-in-ror-webservices/172144)

<div class="topic-metadata">

**Author:** [@sand\_acc](https://www.ruby-forum.com/u/sand_acc)\
**Replies:** 4\
**Last updated:** [July 16, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/small-problem-in-ror-webservices/172144 "2009-07-16T12:14:44Z")

</div>

Hi All, Being a beginner in RoR WebServices, just trying to learn about the different dispathing mechanisms. Direct dispatching is working fine, but unable to get a perfect example for layered and delegated diapatchin…

---

## [Many-to-many relationships between model using different db](https://www.ruby-forum.com/t/many-to-many-relationships-between-model-using-different-db/172178)

<div class="topic-metadata">

**Author:** [@virendra](https://www.ruby-forum.com/u/virendra)\
**Replies:** 2\
**Last updated:** [July 16, 2009, 11:59am UTC](https://www.ruby-forum.com/t/many-to-many-relationships-between-model-using-different-db/172178 "2009-07-16T11:59:20Z")

</div>

Hello to all I am finding out ways to set many-to-many relationships between my two models with each model belonging to a separate database. for e.g I have a “User” Model belonging to “database\_1” I have a “Proje…

---

## [Will\_paginate with more than one table](https://www.ruby-forum.com/t/will-paginate-with-more-than-one-table/172159)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 2\
**Last updated:** [July 16, 2009, 11:57am UTC](https://www.ruby-forum.com/t/will-paginate-with-more-than-one-table/172159 "2009-07-16T11:57:20Z")

</div>

Hi you all, I have an app where I do two “finds” in different tables: @results\_m = Man.find(:all) @results\_w = Woman.find(:all) I can paginate each of one with paginate: @results\_m = Man.paginate(\[params page stuff h…

---

## [Plz hlp :-( Link is not directing to function in controller](https://www.ruby-forum.com/t/plz-hlp-link-is-not-directing-to-function-in-controller/172176)

<div class="topic-metadata">

**Author:** [@venkat\_ruby](https://www.ruby-forum.com/u/venkat_ruby)\
**Replies:** 3\
**Last updated:** [July 16, 2009, 11:55am UTC](https://www.ruby-forum.com/t/plz-hlp-link-is-not-directing-to-function-in-controller/172176 "2009-07-16T11:55:31Z")

</div>

Hi all, The below link is not directing to media\_files\_list function but directing to the show function. Please help, i want to direct it to media\_files\_list function. In controller i declared… def media\_files\_list …

---

## [Linking many to one id column](https://www.ruby-forum.com/t/linking-many-to-one-id-column/172145)

<div class="topic-metadata">

**Author:** [@elmy-liddiard](https://www.ruby-forum.com/u/elmy-liddiard)\
**Replies:** 2\
**Last updated:** [July 16, 2009, 10:35am UTC](https://www.ruby-forum.com/t/linking-many-to-one-id-column/172145 "2009-07-16T10:35:56Z")

</div>

Another newbie question I fear but help as always appreciated. I have a tools table and a controls table and for each ‘tool’ I allow user to specify upto 3 controls. So the Tools table is :- id desc control\_id1 co…

---

## [\[ANN\] Snail, a plugin for international mailing addresses](https://www.ruby-forum.com/t/ann-snail-a-plugin-for-international-mailing-addresses/172166)

<div class="topic-metadata">

**Author:** [@lance](https://www.ruby-forum.com/u/lance)\
**Replies:** 3\
**Last updated:** [July 16, 2009, 10:34am UTC](https://www.ruby-forum.com/t/ann-snail-a-plugin-for-international-mailing-addresses/172166 "2009-07-16T10:34:17Z")

</div>

Howdy – I couldn’t find any existing libraries to help format international mailing addresses. Turns out it’s rather tedious. Not only do different countries have different names for the components of an address, but…

---

## [How to remove ^M at the end of each line?](https://www.ruby-forum.com/t/how-to-remove-m-at-the-end-of-each-line/171848)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 6\
**Last updated:** [July 16, 2009, 8:37am UTC](https://www.ruby-forum.com/t/how-to-remove-m-at-the-end-of-each-line/171848 "2009-07-16T08:37:47Z")

</div>

I got a string from “text\_area\_tag”. Because the browser working on windows while my rails server working on linux, there is ^M at the end of each line. What I want to do is to remove this character and separate the s…

---

## [Pdf::writer inserting images horizontally](https://www.ruby-forum.com/t/pdf-writer-inserting-images-horizontally/172175)

<div class="topic-metadata">

**Author:** [@Hemali\_C](https://www.ruby-forum.com/u/Hemali_C)\
**Replies:** 0\
**Last updated:** [July 16, 2009, 8:37am UTC](https://www.ruby-forum.com/t/pdf-writer-inserting-images-horizontally/172175 "2009-07-16T08:37:12Z")

</div>

Hi ! I am using pdf::writer and want row of images within pdf …but unable to set it properly using table…any suggestions ?? through pdf.image “path\_to\_image” , I am getting target image to pdf but array of images ar…

---

## [Has\_and\_belongs\_to\_many - help?](https://www.ruby-forum.com/t/has-and-belongs-to-many-help/172136)

<div class="topic-metadata">

**Author:** [@railslist](https://www.ruby-forum.com/u/railslist)\
**Replies:** 5\
**Last updated:** [July 16, 2009, 8:14am UTC](https://www.ruby-forum.com/t/has-and-belongs-to-many-help/172136 "2009-07-16T08:14:37Z")

</div>

I know it has been asked many times, but i could not find any working examples even after 2 days for googling. So, i thought let me ask here. How do I save in HABTM Its a simple application where users should be able …

---

## [Rake db:migrate failing in production in 2.3.2](https://www.ruby-forum.com/t/rake-db-migrate-failing-in-production-in-2-3-2/172156)

<div class="topic-metadata">

**Author:** [@plambert](https://www.ruby-forum.com/u/plambert)\
**Replies:** 1\
**Last updated:** [July 16, 2009, 5:47am UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing-in-production-in-2-3-2/172156 "2009-07-16T05:47:13Z")

</div>

I just upgraded from Rails 2.2.2 to Rails 2.3.2, and found that running rake db:migrate fails now in production mode, unless I add “– require ‘config/environment’” between “rake” and “db:migrate”. The error complains…

---

## [Execute Ruby Script](https://www.ruby-forum.com/t/execute-ruby-script/172081)

<div class="topic-metadata">

**Author:** [@coldie](https://www.ruby-forum.com/u/coldie)\
**Replies:** 8\
**Last updated:** [July 16, 2009, 4:38am UTC](https://www.ruby-forum.com/t/execute-ruby-script/172081 "2009-07-16T04:38:46Z")

</div>

Hi there, i’m wondering if it’s possible to execute a external Ruby-Script via Rails. It is my aim to scan my hard-disc with this script, returning values (my directory-structure) to rails. Can anyone give me a hint…

---

## [Redbox](https://www.ruby-forum.com/t/redbox/172092)

<div class="topic-metadata">

**Author:** [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Replies:** 3\
**Last updated:** [July 16, 2009, 3:51am UTC](https://www.ruby-forum.com/t/redbox/172092 "2009-07-16T03:51:34Z")

</div>

I’m trying to do a simple submission using the redbox plugin. However, the fields for the form I want to display appear properly in the center of the page, the background box created by redbox (with the spinner gif) …

---

## [Cheap hack way to clear a form?](https://www.ruby-forum.com/t/cheap-hack-way-to-clear-a-form/172162)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 1\
**Last updated:** [July 16, 2009, 12:55am UTC](https://www.ruby-forum.com/t/cheap-hack-way-to-clear-a-form/172162 "2009-07-16T00:55:34Z")

</div>

I accidentally figured out a sort of hack way to clear a form. I saw you can write javascript to do this, but if you re render the form in a partial with a different name for the form like name=‘something224554’ based…

---

## [Basics of Capistrano](https://www.ruby-forum.com/t/basics-of-capistrano/172127)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 27\
**Last updated:** [July 15, 2009, 11:56pm UTC](https://www.ruby-forum.com/t/basics-of-capistrano/172127 "2009-07-15T23:56:46Z")

</div>

I’m searching the net but about Capistrano, but can’t get a complete understanding. Could someone please give me some small hints :slight\_smile: I have local developer environment, using git. The remote server also ha…

---

## [\[jobs\]](https://www.ruby-forum.com/t/jobs/172148)

<div class="topic-metadata">

**Author:** [@Eriddick](https://www.ruby-forum.com/u/Eriddick)\
**Replies:** 5\
**Last updated:** [July 15, 2009, 11:49pm UTC](https://www.ruby-forum.com/t/jobs/172148 "2009-07-15T23:49:08Z")

</div>

Hi All- My client is looking to add on one more senior RoR developer. They are a high end fashion retailer in midtown and the position can pay up to $100K. If you know anyone who may be interested feel free to give th…

---

## [Odd Ruby difficulties](https://www.ruby-forum.com/t/odd-ruby-difficulties/172150)

<div class="topic-metadata">

**Author:** [@Byron](https://www.ruby-forum.com/u/Byron)\
**Replies:** 2\
**Last updated:** [July 15, 2009, 11:39pm UTC](https://www.ruby-forum.com/t/odd-ruby-difficulties/172150 "2009-07-15T23:39:12Z")

</div>

Hello, every time I create a Ruby controller and a view I get an error message when trying to open it in a web browser: We’re sorry, but something went wrong. We’ve been notified about this issue and we’ll take a look…

---

## [Running a unit test over and over in script/console](https://www.ruby-forum.com/t/running-a-unit-test-over-and-over-in-script-console/171765)

<div class="topic-metadata">

**Author:** [@chillexistence](https://www.ruby-forum.com/u/chillexistence)\
**Replies:** 7\
**Last updated:** [July 15, 2009, 9:32pm UTC](https://www.ruby-forum.com/t/running-a-unit-test-over-and-over-in-script-console/171765 "2009-07-15T21:32:24Z")

</div>

I started doing this: $ RAILS\_ENV=test script/console load ‘test/unit/models/example\_test.rb’; r = Test::Unit::TestResult.new; reload!; ExampleTest.new(:test\_example1).run® { |c,v| }; pp results and then just hit …

---

## [Script/runner and backgroundrb caching and performance](https://www.ruby-forum.com/t/script-runner-and-backgroundrb-caching-and-performance/172155)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 1\
**Last updated:** [July 15, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/script-runner-and-backgroundrb-caching-and-performance/172155 "2009-07-15T19:09:15Z")

</div>

I have a few questions. One is that it seems like script/runner does some caching because if you destroy a bunch of active record models using myrec.destroy, then if you do a find() of some sort, they are still there …

---

## [Has\_many and has\_one ... and nested form](https://www.ruby-forum.com/t/has-many-and-has-one-and-nested-form/172152)

<div class="topic-metadata">

**Author:** [@worthee](https://www.ruby-forum.com/u/worthee)\
**Replies:** 0\
**Last updated:** [July 15, 2009, 5:58pm UTC](https://www.ruby-forum.com/t/has-many-and-has-one-and-nested-form/172152 "2009-07-15T17:58:31Z")

</div>

Hiya I am looking at Rails 2.3.2 and how to cleanly do the following: I have model User User has many Plans User has one Active Plan New User form has fields on it to create the Active Parent I want to create a new U…

---

## [Auto\_link into \_blank window](https://www.ruby-forum.com/t/auto-link-into-blank-window/171301)

<div class="topic-metadata">

**Author:** [@evandrake](https://www.ruby-forum.com/u/evandrake)\
**Replies:** 1\
**Last updated:** [July 15, 2009, 5:57pm UTC](https://www.ruby-forum.com/t/auto-link-into-blank-window/171301 "2009-07-15T17:57:20Z")

</div>

I cannot seem to auto\_link into a \_blank window. What am I doing wrong? \<%= auto\_link( @restaurant.website, :href\_options =\> {:target =\> ‘\_blank’} ) %\>

---

## [Complete Beginnerâ€¦](https://www.ruby-forum.com/t/complete-beginnera/172093)

<div class="topic-metadata">

**Author:** [@Zooshej](https://www.ruby-forum.com/u/Zooshej)\
**Replies:** 10\
**Last updated:** [July 15, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/complete-beginnera/172093 "2009-07-15T17:48:34Z")

</div>

Hi Folks, I am a Media Designer and Ruby on Rails beginner on a very basic level. I have a good background in HTML & CSS, but that’s basically it. I havent worked with Ruby before and I am just getting startet with t…

---

## [Many to many polymorphic relationships](https://www.ruby-forum.com/t/many-to-many-polymorphic-relationships/172146)

<div class="topic-metadata">

**Author:** [@talex83](https://www.ruby-forum.com/u/talex83)\
**Replies:** 0\
**Last updated:** [July 15, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/many-to-many-polymorphic-relationships/172146 "2009-07-15T17:41:32Z")

</div>

I’ve been struggling to get a clear and straight-forward answer on this one, I’m hoping this time I’ll get it! :smiley: I definitely have a lot to learn still with Rails, however I do understand the problem I’m facing…

---

## [Ruby 1.9.1-p129 and Rails 2.3.2](https://www.ruby-forum.com/t/ruby-1-9-1-p129-and-rails-2-3-2/169237)

<div class="topic-metadata">

**Author:** [@ZhayTee](https://www.ruby-forum.com/u/ZhayTee)\
**Replies:** 3\
**Last updated:** [July 15, 2009, 5:26pm UTC](https://www.ruby-forum.com/t/ruby-1-9-1-p129-and-rails-2-3-2/169237 "2009-07-15T17:26:21Z")

</div>

Hi, According to its release notes, Rails 2.3.2 should run fine on Ruby 1.9.1. Since I’ve read about substantial performance gains from 1.9, I decided to upgrade. I built and installed Ruby 1.9.1-p129 on my server (U…

---

## [Database table restore](https://www.ruby-forum.com/t/database-table-restore/172125)

<div class="topic-metadata">

**Author:** [@santoshturamari](https://www.ruby-forum.com/u/santoshturamari)\
**Replies:** 1\
**Last updated:** [July 15, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/database-table-restore/172125 "2009-07-15T17:23:25Z")

</div>

Hi guys, We have a table named layoff\_comments in our database, but accidentally we have deleted(lost) all the data from this table, we have backup, and we want to restore that table, without dropping the current dat…

---

## [Reading AR validations at runtime](https://www.ruby-forum.com/t/reading-ar-validations-at-runtime/172123)

<div class="topic-metadata">

**Author:** [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Replies:** 2\
**Last updated:** [July 15, 2009, 5:19pm UTC](https://www.ruby-forum.com/t/reading-ar-validations-at-runtime/172123 "2009-07-15T17:19:48Z")

</div>

Does anyone, by chance, know how to obtain a list of all the defined activerecord validations at runtime? In other words, I’d like to query a model for all the fields that are unique, or required. I found this: read\_…

---

## [More on Symbols](https://www.ruby-forum.com/t/more-on-symbols/172124)

<div class="topic-metadata">

**Author:** [@shusseina](https://www.ruby-forum.com/u/shusseina)\
**Replies:** 6\
**Last updated:** [July 15, 2009, 4:13pm UTC](https://www.ruby-forum.com/t/more-on-symbols/172124 "2009-07-15T16:13:16Z")

</div>

From what I have read, in Ruby a Symbol is prefixed with a colon as in :my\_symbol, yet I can do this… :my\_symbol =\> :my\_symbol my\_variable = :my\_symbol =\> :my\_symbol :my\_symbol.class =\> Symbol :my\_symbol.…

---

## [Undefined method empty? when find first invoked on db](https://www.ruby-forum.com/t/undefined-method-empty-when-find-first-invoked-on-db/172140)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 2\
**Last updated:** [July 15, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/undefined-method-empty-when-find-first-invoked-on-db/172140 "2009-07-15T15:54:34Z")

</div>

if model.compiled\_this\_week.first.empty? OR if model.compiled\_this\_week.find(:first).empty? … return undefined method empty? if model.compiled\_this\_week.all.empty? OR if model.compiled\_this\_week.find(:all).empty? ……

---

## [Attachment\_fu problem:](https://www.ruby-forum.com/t/attachment-fu-problem/172130)

<div class="topic-metadata">

**Author:** [@Xiahong\_G](https://www.ruby-forum.com/u/Xiahong_G)\
**Replies:** 1\
**Last updated:** [July 15, 2009, 3:19pm UTC](https://www.ruby-forum.com/t/attachment-fu-problem/172130 "2009-07-15T15:19:16Z")

</div>

Hi everyone, I was trying to do image upload by using attachment\_fu but got no lucky. I have 2 models: album and cover. Each album is associated with only one cover. The database is like: create\_table :covers do |t| …

---

## [Rails time triggered actions](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131)

<div class="topic-metadata">

**Author:** [@enzor](https://www.ruby-forum.com/u/enzor)\
**Replies:** 3\
**Last updated:** [July 15, 2009, 2:03pm UTC](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131 "2009-07-15T14:03:40Z")

</div>

Is there a way to make some method to act on a specific time? Right now, i managed to bypass this problem by attaching this method to the login factor of the site (everytime an admin log in the site, also this method …

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

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