# Rails

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

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

---

## [Find\_by\_ problem](https://www.ruby-forum.com/t/find-by-problem/141593)

<div class="topic-metadata">

**Author:** [@hemisphere](https://www.ruby-forum.com/u/hemisphere)\
**Replies:** 11\
**Last updated:** [June 27, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/find-by-problem/141593 "2008-06-27T16:27:10Z")

</div>

This works only if one record is matched, but there are two or more records it only prints first of the record. Please help me, i’m just beginner in rails This is my controller: def search @info= Info.find\_by\_name(p…

---

## [Add Migration in Edge not adding requested columns](https://www.ruby-forum.com/t/add-migration-in-edge-not-adding-requested-columns/133678)

<div class="topic-metadata">

**Author:** [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Replies:** 6\
**Last updated:** [June 27, 2008, 4:10pm UTC](https://www.ruby-forum.com/t/add-migration-in-edge-not-adding-requested-columns/133678 "2008-06-27T16:10:11Z")

</div>

I decided to just test the new feature in edge (and soon to be in Rails 2.1) where migrations are created using a UTC timestamp instead of a number. In a test project, where I’ve done a rake rails:freeze:edge, I did: …

---

## [Light box recommendations](https://www.ruby-forum.com/t/light-box-recommendations/141590)

<div class="topic-metadata">

**Author:** [@ss\_1982](https://www.ruby-forum.com/u/ss_1982)\
**Replies:** 2\
**Last updated:** [June 27, 2008, 2:41pm UTC](https://www.ruby-forum.com/t/light-box-recommendations/141590 "2008-06-27T14:41:05Z")

</div>

Hi, I need to make use of a light box lib on a new site, this needs to be capable of showing complete pages / actions along with maps if possible. Has anyone got any recommendations on which one to use Cheers, Scott …

---

## [Searching for strings in html pages](https://www.ruby-forum.com/t/searching-for-strings-in-html-pages/141597)

<div class="topic-metadata">

**Author:** [@adrianod](https://www.ruby-forum.com/u/adrianod)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 2:32pm UTC](https://www.ruby-forum.com/t/searching-for-strings-in-html-pages/141597 "2008-06-27T14:32:17Z")

</div>

Hi I want to know how I can search for a string in some for example i want to open www.page.com and search for the string “Welcome Adrian”

---

## [Question on passing arguments inside a view](https://www.ruby-forum.com/t/question-on-passing-arguments-inside-a-view/141357)

<div class="topic-metadata">

**Author:** [@scottc12](https://www.ruby-forum.com/u/scottc12)\
**Replies:** 10\
**Last updated:** [June 27, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/question-on-passing-arguments-inside-a-view/141357 "2008-06-27T14:31:42Z")

</div>

I’m running into an issue undefined local variable or method \`directoryid’ for #EditorialsController:0x23f1bf8 I have two Models on a legacy database and only one controller called editorials with two actions index an…

---

## [Authentication cookies](https://www.ruby-forum.com/t/authentication-cookies/196728)

<div class="topic-metadata">

**Author:** [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Replies:** 6\
**Last updated:** [June 27, 2008, 2:07pm UTC](https://www.ruby-forum.com/t/authentication-cookies/196728 "2008-06-27T14:07:59Z")

</div>

I would like to know if it is possible to share Authentication cookies between 2 url’s with ruby. Does anyone know how to? thanks

---

## [Rails 2.1 DST Issues](https://www.ruby-forum.com/t/rails-2-1-dst-issues/141595)

<div class="topic-metadata">

**Author:** [@nauhaie](https://www.ruby-forum.com/u/nauhaie)\
**Replies:** 0\
**Last updated:** [June 27, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/rails-2-1-dst-issues/141595 "2008-06-27T13:49:34Z")

</div>

Hi all! Here is some interesting result with Rails 2.1 (without any specific TimeZone configuration). As you will see, adding 3.hours and then 21.hours doesn’t give the same result as adding 24.hours around DST chang…

---

## [Gem commands never get to an end](https://www.ruby-forum.com/t/gem-commands-never-get-to-an-end/141583)

<div class="topic-metadata">

**Author:** [@Odium](https://www.ruby-forum.com/u/Odium)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 1:07pm UTC](https://www.ruby-forum.com/t/gem-commands-never-get-to-an-end/141583 "2008-06-27T13:07:37Z")

</div>

Hi List, i use mod\_passenger 1.0.1, ruby 1.8.5, rails 2.0.2, gem 0.9.4 on Suse Linux 10.1 unfortunately i have a problem with updating gems On Consolte i try: gem update --system this command never gets to an end. …

---

## [Find\_by\_sql + Join + Rails 2](https://www.ruby-forum.com/t/find-by-sql-join-rails-2/141548)

<div class="topic-metadata">

**Author:** [@shafi](https://www.ruby-forum.com/u/shafi)\
**Replies:** 9\
**Last updated:** [June 27, 2008, 12:29pm UTC](https://www.ruby-forum.com/t/find-by-sql-join-rails-2/141548 "2008-06-27T12:29:22Z")

</div>

Hello I have write a code to select data from two tables (T1,T2) but the problem is @tables= T1.find\_by\_sql("select T1.,T2. from T1inner join T2on T1.followup\_id = T2.id where followups.userid = ‘41’ ") THe problem …

---

## [Find\_by\_sql order by date field issue](https://www.ruby-forum.com/t/find-by-sql-order-by-date-field-issue/141563)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 8\
**Last updated:** [June 27, 2008, 12:21pm UTC](https://www.ruby-forum.com/t/find-by-sql-order-by-date-field-issue/141563 "2008-06-27T12:21:54Z")

</div>

I have a giant query that union around 10 tables together. Each of the queries consists of joins too. At the end I do a order by date field, time field. If I run this query in SQL alone it works just fine and if I …

---

## [Add validation error from associated model to parent](https://www.ruby-forum.com/t/add-validation-error-from-associated-model-to-parent/141584)

<div class="topic-metadata">

**Author:** [@miv](https://www.ruby-forum.com/u/miv)\
**Replies:** 0\
**Last updated:** [June 27, 2008, 10:42am UTC](https://www.ruby-forum.com/t/add-validation-error-from-associated-model-to-parent/141584 "2008-06-27T10:42:54Z")

</div>

so basically i has this setup (example): class FellowUser \< ActiveRecord::Base belongs\_to :fellow belongs\_to :user end class Fellows \< ActiveRecord::Base belongs\_to :user has\_many :fellow\_users has\_many :fellows,…

---

## [The @automaton variable appears to be empty. Did you forget to pass the collection object for will\_](https://www.ruby-forum.com/t/the-automaton-variable-appears-to-be-empty-did-you-forget-to-pass-the-collection-object-for-will/141582)

<div class="topic-metadata">

**Author:** [@sadeesh\_kumar](https://www.ruby-forum.com/u/sadeesh_kumar)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 10:21am UTC](https://www.ruby-forum.com/t/the-automaton-variable-appears-to-be-empty-did-you-forget-to-pass-the-collection-object-for-will/141582 "2008-06-27T10:21:48Z")

</div>

Hi, I Got will\_paginate as gem and added required things is config/ environment.rb. My controller code, ------\>8-------- @triedmails = Triedmail.paginate :all, :page =\> params\[:page\] ------8\<------- My view code, …

---

## [Getting raise\_on\_type\_mismatch](https://www.ruby-forum.com/t/getting-raise-on-type-mismatch/141581)

<div class="topic-metadata">

**Author:** [@Hemal\_M](https://www.ruby-forum.com/u/Hemal_M)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 10:17am UTC](https://www.ruby-forum.com/t/getting-raise-on-type-mismatch/141581 "2008-06-27T10:17:06Z")

</div>

Hello, I am a newbie Ruby developer. I have an “Bookstore” application consisting of Books Prices. In the Edit page, I am trying to associate Books with Price. The Books and Prices has a has\_one relationship and belon…

---

## [Serving static html files out of /public](https://www.ruby-forum.com/t/serving-static-html-files-out-of-public/141574)

<div class="topic-metadata">

**Author:** [@rob](https://www.ruby-forum.com/u/rob)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 9:53am UTC](https://www.ruby-forum.com/t/serving-static-html-files-out-of-public/141574 "2008-06-27T09:53:40Z")

</div>

Hi all, I have added a rails app to a pre-existing static website. I have put all the legacy content (i.e. html files and images) in the public dir and sub-dirs as appropriate. Everything works fine - both the rails…

---

## [Syntax](https://www.ruby-forum.com/t/syntax/141568)

<div class="topic-metadata">

**Author:** [@northwind](https://www.ruby-forum.com/u/northwind)\
**Replies:** 5\
**Last updated:** [June 27, 2008, 9:43am UTC](https://www.ruby-forum.com/t/syntax/141568 "2008-06-27T09:43:08Z")

</div>

Hi, Can someone point me to a resource to learn about syntax like this: “%#{search}%” I understand everything but the two percent signs. I tried googling but various searches on curly braces and percent signs broug…

---

## [Overriding default values - model advice](https://www.ruby-forum.com/t/overriding-default-values-model-advice/141477)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 2\
**Last updated:** [June 27, 2008, 9:06am UTC](https://www.ruby-forum.com/t/overriding-default-values-model-advice/141477 "2008-06-27T09:06:52Z")

</div>

I am looking for some advice in putting together the proper models and relationships in my application. My concern revolves around the requirement to have default prices, but allow them to be optionally overridable. …

---

## [Select with prompt sends blank to validates\_inclusion\_of?](https://www.ruby-forum.com/t/select-with-prompt-sends-blank-to-validates-inclusion-of/141396)

<div class="topic-metadata">

**Author:** [@hozer](https://www.ruby-forum.com/u/hozer)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 8:48am UTC](https://www.ruby-forum.com/t/select-with-prompt-sends-blank-to-validates-inclusion-of/141396 "2008-06-27T08:48:06Z")

</div>

Hi All, I hope somebody can help. I’m a bit confused about what would be the best practice for handling an enumerated model value with FormOptionsHelper.select + validates\_inclusion\_of. Specifically the nil handling. …

---

## [Missing C-based MySQL library for Mac OS X?](https://www.ruby-forum.com/t/missing-c-based-mysql-library-for-mac-os-x/128661)

<div class="topic-metadata">

**Author:** [@ric](https://www.ruby-forum.com/u/ric)\
**Replies:** 7\
**Last updated:** [June 27, 2008, 8:15am UTC](https://www.ruby-forum.com/t/missing-c-based-mysql-library-for-mac-os-x/128661 "2008-06-27T08:15:06Z")

</div>

My Environment: OS X (Leopard 10.5.1) Ruby v 1.8.6 Rails v 2.0.2 Gem v 0.9.4 Server: Mongrel MySQL version: mysql Ver 14.14 Distrib 5.1.22-rc, for apple-darwin8.5.1 (i686) using readline 5.0 Greetings: I notic…

---

## [Freeze and dependence problems?](https://www.ruby-forum.com/t/freeze-and-dependence-problems/141469)

<div class="topic-metadata">

**Author:** [@ferblape](https://www.ruby-forum.com/u/ferblape)\
**Replies:** 3\
**Last updated:** [June 27, 2008, 7:15am UTC](https://www.ruby-forum.com/t/freeze-and-dependence-problems/141469 "2008-06-27T07:15:54Z")

</div>

Hello I have a server using Rails 1.1.6 So I developed my application on my computer, with Rails 2.1 After that I did a rake rails:freeze:gems. That sent Rail gems was sent to /vendor/rails I sent my application to …

---

## [Do sweepers work across app servers?](https://www.ruby-forum.com/t/do-sweepers-work-across-app-servers/141561)

<div class="topic-metadata">

**Author:** [@nolman](https://www.ruby-forum.com/u/nolman)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 6:30am UTC](https://www.ruby-forum.com/t/do-sweepers-work-across-app-servers/141561 "2008-06-27T06:30:02Z")

</div>

If I had a dozen App servers and one DB would my all my app servers be notified via sweepers when a given representation was updated? If not what cache expiring mechanisms are there that can be used across multi app …

---

## [Gem install rails issue CRC error](https://www.ruby-forum.com/t/gem-install-rails-issue-crc-error/141572)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 0\
**Last updated:** [June 27, 2008, 6:26am UTC](https://www.ruby-forum.com/t/gem-install-rails-issue-crc-error/141572 "2008-06-27T06:26:53Z")

</div>

im trying to install rails with gem. i have compiled 1.8.6 from source and am running gem 1.1.1 here is the output: \[root@webapp1 ~\]# gem install rails --include-dependencies --verbose –backtrace INFO: gem install…

---

## [Installation Problem: Invalid Gem format](https://www.ruby-forum.com/t/installation-problem-invalid-gem-format/125328)

<div class="topic-metadata">

**Author:** [@dizz](https://www.ruby-forum.com/u/dizz)\
**Replies:** 4\
**Last updated:** [June 27, 2008, 6:01am UTC](https://www.ruby-forum.com/t/installation-problem-invalid-gem-format/125328 "2008-06-27T06:01:54Z")

</div>

Hey I am having a problem installing rails on my ubuntu machine. I cannot install any gems and keep on getting the following error. ERROR: Error installing rails: invalid gem format for /usr/lib/ruby/gems/1.8/cache/ …

---

## [Update database on checkbox update](https://www.ruby-forum.com/t/update-database-on-checkbox-update/141569)

<div class="topic-metadata">

**Author:** [@killy971](https://www.ruby-forum.com/u/killy971)\
**Replies:** 0\
**Last updated:** [June 27, 2008, 5:42am UTC](https://www.ruby-forum.com/t/update-database-on-checkbox-update/141569 "2008-06-27T05:42:28Z")

</div>

I have search the web for help, with the keywords “rails ajax observe\_field update checkbox”, but even using all the things I found, I couldn’t really get my application for work properly… I think I lack of understand…

---

## [Tough call on rails hosting site](https://www.ruby-forum.com/t/tough-call-on-rails-hosting-site/141476)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 10\
**Last updated:** [June 27, 2008, 4:50am UTC](https://www.ruby-forum.com/t/tough-call-on-rails-hosting-site/141476 "2008-06-27T04:50:26Z")

</div>

I have a site wl.kuliksco.com which i’m currently running on my home computer. i get about 600-700 hits a day but plan on getting into the few thousands in the next month. my pages each have about 100 thumbnails each…

---

## [Ruby compile error on new slicehost.com vps](https://www.ruby-forum.com/t/ruby-compile-error-on-new-slicehost-com-vps/141541)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 26\
**Last updated:** [June 27, 2008, 4:24am UTC](https://www.ruby-forum.com/t/ruby-compile-error-on-new-slicehost-com-vps/141541 "2008-06-27T04:24:06Z")

</div>

I just purchased a centOS5 vps from slicehost.com earlier today. I have installed the following so far: yum install httpd yum install glibc yum install gcc yum install gcc-c++ yum install make I downloaded ruby 1.…

---

## [Rails App Database in MySQL - OK, However what if I need to access multiple Databases of different](https://www.ruby-forum.com/t/rails-app-database-in-mysql-ok-however-what-if-i-need-to-access-multiple-databases-of-different/141478)

<div class="topic-metadata">

**Author:** [@housekeeping](https://www.ruby-forum.com/u/housekeeping)\
**Replies:** 3\
**Last updated:** [June 27, 2008, 3:25am UTC](https://www.ruby-forum.com/t/rails-app-database-in-mysql-ok-however-what-if-i-need-to-access-multiple-databases-of-different/141478 "2008-06-27T03:25:04Z")

</div>

Hi, Although I am an experienced developer, I am new to rails and enjoying how easy it is to build applications. I seem to have come across a stumbling block and was wondering if anyone out there has come across the …

---

## [Attachment\_fu working locally but not on server](https://www.ruby-forum.com/t/attachment-fu-working-locally-but-not-on-server/141558)

<div class="topic-metadata">

**Author:** [@pk16](https://www.ruby-forum.com/u/pk16)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 3:21am UTC](https://www.ruby-forum.com/t/attachment-fu-working-locally-but-not-on-server/141558 "2008-06-27T03:21:33Z")

</div>

Hi, I’m trouble shooting a strange issue and was wondering if anyone could point me in the right direction. I installed attachment\_fu as a plugin using instant rails 2.0.2 locally. Everything is working fine but when …

---

## [Odd to\_a deprecation message when calling association.include?(polymorphic object)](https://www.ruby-forum.com/t/odd-to-a-deprecation-message-when-calling-association-include-polymorphic-object/141562)

<div class="topic-metadata">

**Author:** [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Replies:** 0\
**Last updated:** [June 27, 2008, 2:55am UTC](https://www.ruby-forum.com/t/odd-to-a-deprecation-message-when-calling-association-include-polymorphic-object/141562 "2008-06-27T02:55:14Z")

</div>

I’ve been getting the follow deprecation message a lot since upgrading to 2.1 /Users/choi/prx/vendor/rails/activerecord/lib/active\_record/ associations/association\_proxy.rb:184: warning: default \`to\_a’ will be obsole…

---

## [Finding our current depth in a tree (acts\_as\_tree)](https://www.ruby-forum.com/t/finding-our-current-depth-in-a-tree-acts-as-tree/141560)

<div class="topic-metadata">

**Author:** [@brendon](https://www.ruby-forum.com/u/brendon)\
**Replies:** 1\
**Last updated:** [June 27, 2008, 1:57am UTC](https://www.ruby-forum.com/t/finding-our-current-depth-in-a-tree-acts-as-tree/141560 "2008-06-27T01:57:57Z")

</div>

Hi there, I’m building an indexbar that has two parameters: It’ll display the current item, its siblings and it’s parents siblings (recursively) to a height provided in variable. It’ll stop climbing if we reach a cert…

---

## [ActiveRecord get all columns including those belonging](https://www.ruby-forum.com/t/activerecord-get-all-columns-including-those-belonging/141480)

<div class="topic-metadata">

**Author:** [@ryan\_bayona](https://www.ruby-forum.com/u/ryan_bayona)\
**Replies:** 3\
**Last updated:** [June 27, 2008, 12:14am UTC](https://www.ruby-forum.com/t/activerecord-get-all-columns-including-those-belonging/141480 "2008-06-27T00:14:58Z")

</div>

Hi, Just new to Rails, and i have some questions : How can i use ActiveRecord associations to retrieve all columns and rows including the columns and rows in the referenced table.? \*SELECT parents.id, parents.parent\_…

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

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