# Rails

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

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

---

## [Link\_to 'comments', @article.comments?](https://www.ruby-forum.com/t/link-to-comments-article-comments/138242)

<div class="topic-metadata">

**Author:** [@Izidor\_J](https://www.ruby-forum.com/u/Izidor_J)\
**Replies:** 4\
**Last updated:** [May 21, 2008, 10:35am UTC](https://www.ruby-forum.com/t/link-to-comments-article-comments/138242 "2008-05-21T10:35:21Z")

</div>

Hello, in a restful application, I am trying to create the thing mentioned int he subject: link to the association, e.g. /articles/1/comments. The “link\_to ‘comments’, @article.comments” doesn’t do anything good for …

---

## [Dojo Tree](https://www.ruby-forum.com/t/dojo-tree/125169)

<div class="topic-metadata">

**Author:** [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Replies:** 4\
**Last updated:** [May 21, 2008, 10:20am UTC](https://www.ruby-forum.com/t/dojo-tree/125169 "2008-05-21T10:20:04Z")

</div>

Hello, I need to implement a drag and drop tree in rails. I saw the demo of the dojo tree and that is something that i wwould like to have. Can anyone please tell me how do i make that tree by getting the data from th…

---

## [Undefined method error](https://www.ruby-forum.com/t/undefined-method-error/138245)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 10:18am UTC](https://www.ruby-forum.com/t/undefined-method-error/138245 "2008-05-21T10:18:53Z")

</div>

Hi I have controoler code as @sd\_activities=ServiceDeskActivity.find\_all\_by\_service\_desk\_ticket\_id(service\_desk\_ticket.id).display\_sd\_activities(params\[:page\]) The in the model ServiceDeskActivity def self.display\_sd…

---

## [Recieve email from gmail using POP3](https://www.ruby-forum.com/t/recieve-email-from-gmail-using-pop3/138227)

<div class="topic-metadata">

**Author:** [@hloooi](https://www.ruby-forum.com/u/hloooi)\
**Replies:** 5\
**Last updated:** [May 21, 2008, 10:12am UTC](https://www.ruby-forum.com/t/recieve-email-from-gmail-using-pop3/138227 "2008-05-21T10:12:13Z")

</div>

can someone help me out with this folder… im stuck and i cant trouble shoot where is the error thx alot~~~

---

## [Problem while using Effect.toggle( )](https://www.ruby-forum.com/t/problem-while-using-effect-toggle/138135)

<div class="topic-metadata">

**Author:** [@jagdishSRubin](https://www.ruby-forum.com/u/jagdishSRubin)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 9:42am UTC](https://www.ruby-forum.com/t/problem-while-using-effect-toggle/138135 "2008-05-21T09:42:21Z")

</div>

Hi I’m new in rails…I have a problem plz help me… I’m using Effect.toggle in my code. But it is not working…My code is like this… \<%=link\_to\_function “Toggle this”, onClick=“Effect.toggle( ‘ddiv’, ‘slide’ ); return f…

---

## ["save! and rescure" or if-else](https://www.ruby-forum.com/t/save-and-rescure-or-if-else/138217)

<div class="topic-metadata">

**Author:** [@T\_K](https://www.ruby-forum.com/u/T_K)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 8:31am UTC](https://www.ruby-forum.com/t/save-and-rescure-or-if-else/138217 "2008-05-21T08:31:14Z")

</div>

When browsing various projects, I noticed two ways to write a saving feature. def create if @post.save flash\[:notice\] = “Success” redirect\_to :action =\> “index” else render :action =\> “new” end def creat…

---

## [Issue with hyphen](https://www.ruby-forum.com/t/issue-with-hyphen/138229)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 8:27am UTC](https://www.ruby-forum.com/t/issue-with-hyphen/138229 "2008-05-21T08:27:42Z")

</div>

I have a column name that has a hyphen… not the table name but column name… I am calling something like: @online = Status.find(:first, :conditions =\> {:status =\> ‘online’} ) first problem I notes using the IRB consol…

---

## [Setting find conditions to equal a value 2 tbl joins away](https://www.ruby-forum.com/t/setting-find-conditions-to-equal-a-value-2-tbl-joins-away/138201)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 8:21am UTC](https://www.ruby-forum.com/t/setting-find-conditions-to-equal-a-value-2-tbl-joins-away/138201 "2008-05-21T08:21:50Z")

</div>

ok here is my initial table setups: ITEM TYPES id name ITEMS id name item\_type\_id TOOLS id item\_id parent\_id class Tool \< ActiveRecord::Base belongs\_to :item def name item.name end def item\_type item.i…

---

## [Accessing Instance Variable from ApplicationController](https://www.ruby-forum.com/t/accessing-instance-variable-from-applicationcontroller/138233)

<div class="topic-metadata">

**Author:** [@GarrettB](https://www.ruby-forum.com/u/GarrettB)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 8:10am UTC](https://www.ruby-forum.com/t/accessing-instance-variable-from-applicationcontroller/138233 "2008-05-21T08:10:08Z")

</div>

In my layouts/application.rhtml, I am trying to pass in a instance variable: @skills = Skill.find(:all, :limit =\> 9) Inside the application.rhtml, I debug @skills and all that returns is: I also tried the @@. I assu…

---

## [Oracle snipes my idle connections](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142)

<div class="topic-metadata">

**Author:** [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 7:47am UTC](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142 "2008-05-21T07:47:18Z")

</div>

I’ve got a very low traffic site running against Oracle. The monitors show my ruby processes holding their database connections for the maximum time configured, at which time they are “sniped”. I am relying on Rails…

---

## [Finding parents with red-haired children?](https://www.ruby-forum.com/t/finding-parents-with-red-haired-children/138163)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 9\
**Last updated:** [May 21, 2008, 7:37am UTC](https://www.ruby-forum.com/t/finding-parents-with-red-haired-children/138163 "2008-05-21T07:37:55Z")

</div>

Here’s the basic situation class Person \< ActiveRecord::Base acts\_as\_tree belongs\_to :hair\_color validates\_presence\_of :name end class HairColor \< ActiveRecord::Base validates\_presence\_of :name end What I want t…

---

## [Callback method for field](https://www.ruby-forum.com/t/callback-method-for-field/138230)

<div class="topic-metadata">

**Author:** [@ayyanar](https://www.ruby-forum.com/u/ayyanar)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 7:23am UTC](https://www.ruby-forum.com/t/callback-method-for-field/138230 "2008-05-21T07:23:09Z")

</div>

Is there callback method for field level? Generally, after\_create and after\_save will fire at object level. I need to fire some code when the value for the field is changed. I need to call the call back method from ob…

---

## [Code for download](https://www.ruby-forum.com/t/code-for-download/136805)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 12\
**Last updated:** [May 21, 2008, 7:02am UTC](https://www.ruby-forum.com/t/code-for-download/136805 "2008-05-21T07:02:59Z")

</div>

hi i am my application i want a some link in which when a user click a file from my server get downloaded to user site. please reply urgent.

---

## [Gem and pluggin](https://www.ruby-forum.com/t/gem-and-pluggin/138122)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 6:06am UTC](https://www.ruby-forum.com/t/gem-and-pluggin/138122 "2008-05-21T06:06:36Z")

</div>

Hi This is a general question.What is the differnece between these ?Why I am asking such a question is i am using will\_paginate pluggin…Now it is available as gem…So is there any performance (stability and speed of e…

---

## [Two database migration (active record)](https://www.ruby-forum.com/t/two-database-migration-active-record/137876)

<div class="topic-metadata">

**Author:** [@fero](https://www.ruby-forum.com/u/fero)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 6:02am UTC](https://www.ruby-forum.com/t/two-database-migration-active-record/137876 "2008-05-21T06:02:24Z")

</div>

Hello. I want to write script, that will migrate one database (with models) to another database (with another models) using ActiveRecord and all of its benefits. It is possible? Please give me any tips. I am moving d…

---

## [Nested Resource - "You are Being Redirected" interim page](https://www.ruby-forum.com/t/nested-resource-you-are-being-redirected-interim-page/138154)

<div class="topic-metadata">

**Author:** [@emh](https://www.ruby-forum.com/u/emh)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 5:57am UTC](https://www.ruby-forum.com/t/nested-resource-you-are-being-redirected-interim-page/138154 "2008-05-21T05:57:44Z")

</div>

Hi, A bit of a noob andtrying to get RESTful nested resources working for the first time. My environments is as follows: Mac Leopard Ruby 1.8.6 Rails 2.0.2 - standard everything, mongrel, etc. Following various in…

---

## [Onmouseover similar to any Clothing Store?](https://www.ruby-forum.com/t/onmouseover-similar-to-any-clothing-store/138204)

<div class="topic-metadata">

**Author:** [@freaknasty](https://www.ruby-forum.com/u/freaknasty)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 4:38am UTC](https://www.ruby-forum.com/t/onmouseover-similar-to-any-clothing-store/138204 "2008-05-21T04:38:01Z")

</div>

Hi everyone, I was wondering what would be needed in doing something similar to the onmouseover events on webpages such as old navy or similar clothing stores? So for example, old navy’s site, when you’re looking at …

---

## [ActiveResource server](https://www.ruby-forum.com/t/activeresource-server/138191)

<div class="topic-metadata">

**Author:** [@pedz](https://www.ruby-forum.com/u/pedz)\
**Replies:** 5\
**Last updated:** [May 21, 2008, 3:30am UTC](https://www.ruby-forum.com/t/activeresource-server/138191 "2008-05-21T03:30:52Z")

</div>

Can anyone point me to documentation, how to’s, etc about how to create an active resource server. I get its trivial to create a client. But I’m wanting to create a server that can be used by input forms and also by…

---

## [\*Don't\* cache \*anything\*. Or, why is Ajax loved so much?](https://www.ruby-forum.com/t/dont-cache-anything-or-why-is-ajax-loved-so-much/138178)

<div class="topic-metadata">

**Author:** [@dewie](https://www.ruby-forum.com/u/dewie)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 2:49am UTC](https://www.ruby-forum.com/t/dont-cache-anything-or-why-is-ajax-loved-so-much/138178 "2008-05-21T02:49:18Z")

</div>

Every search I’ve done on not caching something in Rails inevitably turns up with “so you want to cache?”. No! I’ve got a view that is asking @cart.empty? and answering true, when I expect it to be false. Calling out…

---

## [Find objects related](https://www.ruby-forum.com/t/find-objects-related/138187)

<div class="topic-metadata">

**Author:** [@julien51](https://www.ruby-forum.com/u/julien51)\
**Replies:** 5\
**Last updated:** [May 21, 2008, 1:12am UTC](https://www.ruby-forum.com/t/find-objects-related/138187 "2008-05-21T01:12:08Z")

</div>

Hi everybody, I am working on an app and I need the following behavior : A :has\_many B A :has\_many C :though B and C :has\_many B C has\_many A :through B My goal is to find all the A objects that are related to a g…

---

## [Namespaced routes](https://www.ruby-forum.com/t/namespaced-routes/138194)

<div class="topic-metadata">

**Author:** [@twoism](https://www.ruby-forum.com/u/twoism)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 12:45am UTC](https://www.ruby-forum.com/t/namespaced-routes/138194 "2008-05-21T00:45:12Z")

</div>

Could someone tell me how you would set up default routes within a namspace similar to this… map.connect ‘:namespace/:controller/:action/:id’ I have tried several ways inside… map.namespace :example\_namespace do |a| …

---

## [This Week in Ruby (May 20, 2008)](https://www.ruby-forum.com/t/this-week-in-ruby-may-20-2008/138197)

<div class="topic-metadata">

**Author:** [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 12:38am UTC](https://www.ruby-forum.com/t/this-week-in-ruby-may-20-2008/138197 "2008-05-21T00:38:45Z")

</div>

Hi all, here you can find the 8th edition of “This Week in Ruby”: Cheers, Antonio http://antoniocangiano.com - Zen and the Art of Programming http://stacktrace.it | http://math-blog.com http://twi…

---

## [Printing the contents of variables to the screen legibly](https://www.ruby-forum.com/t/printing-the-contents-of-variables-to-the-screen-legibly/138184)

<div class="topic-metadata">

**Author:** [@validkeys](https://www.ruby-forum.com/u/validkeys)\
**Replies:** 5\
**Last updated:** [May 21, 2008, 12:32am UTC](https://www.ruby-forum.com/t/printing-the-contents-of-variables-to-the-screen-legibly/138184 "2008-05-21T00:32:47Z")

</div>

Hi there, I am a recent convert from PHP, specifically CakePHP. When I would run a query in CakePHP and read that query into an array, I could run a function debug() on that array and it would print all of the content…

---

## [Debugger in Rails Console](https://www.ruby-forum.com/t/debugger-in-rails-console/138181)

<div class="topic-metadata">

**Author:** [@arco](https://www.ruby-forum.com/u/arco)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 12:12am UTC](https://www.ruby-forum.com/t/debugger-in-rails-console/138181 "2008-05-21T00:12:58Z")

</div>

I can embed ‘debugger’ statements in my controllers or models, and this triggers breakpoints when I run my app via the webserver using ‘script/server –debugger’. However, when I run the app via the console using ‘rdeb…

---

## [Reserved words in routes](https://www.ruby-forum.com/t/reserved-words-in-routes/130266)

<div class="topic-metadata">

**Author:** [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 12:11am UTC](https://www.ruby-forum.com/t/reserved-words-in-routes/130266 "2008-05-21T00:11:34Z")

</div>

I have some models in a system that have less-than-ideal names because the ‘natural’ names clash with reserved words. In order to get nicer URLs I’ve put some entries in the routes file, mapping the reserved words to …

---

## [Converting String maybe](https://www.ruby-forum.com/t/converting-string-maybe/138192)

<div class="topic-metadata">

**Author:** [@nameth](https://www.ruby-forum.com/u/nameth)\
**Replies:** 1\
**Last updated:** [May 20, 2008, 11:53pm UTC](https://www.ruby-forum.com/t/converting-string-maybe/138192 "2008-05-20T23:53:35Z")

</div>

is this possible and if so how? Thanks fin = “BfAmProducts.find\_all\_by\_bp\_cat\_main\_id\_1 1000” products = fin This is what i want to get products = BfAmProducts.find\_all\_by\_bp\_cat\_main\_id\_1 1000 ##Getting this produc…

---

## [What does this represent : ENV\["\_"\]](https://www.ruby-forum.com/t/what-does-this-represent-env/138172)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 6\
**Last updated:** [May 20, 2008, 10:37pm UTC](https://www.ruby-forum.com/t/what-does-this-represent-env/138172 "2008-05-20T22:37:42Z")

</div>

Hi, Does somebody know to what the following exactly refers to? ENV\["\_"\] I have read about ‘ENV\[“RAILS\_ENV”\]’ but don’t understand the above mentioned. -\> Is this something defined by Rails itself or is it some cust…

---

## [2 level horizontal navigation in Rails](https://www.ruby-forum.com/t/2-level-horizontal-navigation-in-rails/138054)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 5\
**Last updated:** [May 20, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/2-level-horizontal-navigation-in-rails/138054 "2008-05-20T21:43:22Z")

</div>

Hi, I want navigation structure like this… Home Products Software Hardware Someone good ideas or link, plugins, helpers to realize this in rails? swoany

---

## [Namespaced routes](https://www.ruby-forum.com/t/namespaced-routes/138182)

<div class="topic-metadata">

**Author:** [@Chris\_Burnett](https://www.ruby-forum.com/u/Chris_Burnett)\
**Replies:** 0\
**Last updated:** [May 20, 2008, 9:38pm UTC](https://www.ruby-forum.com/t/namespaced-routes/138182 "2008-05-20T21:38:39Z")

</div>

Could someone tell me how you would set up default routes within a namspace similar to this… map.connect ‘:namspace/:controller/:action/:id’ I have tried several ways inside… map.namespace :example do |a| end with…

---

## [Migrations, the "right" way](https://www.ruby-forum.com/t/migrations-the-right-way/138077)

<div class="topic-metadata">

**Author:** [@dustin](https://www.ruby-forum.com/u/dustin)\
**Replies:** 8\
**Last updated:** [May 20, 2008, 9:36pm UTC](https://www.ruby-forum.com/t/migrations-the-right-way/138077 "2008-05-20T21:36:17Z")

</div>

I’ve got the Agile Web D. with Rails book that tells me to do migrations different than the what is explained on api.rubyonrails.org under ActiveRecord::Migration What is the “best” or “right” syntax of migrations?

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

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