# Rails

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

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

---

## [Trouble passing :id of one model to another model](https://www.ruby-forum.com/t/trouble-passing-id-of-one-model-to-another-model/130617)

<div class="topic-metadata">

**Author:** [@loominator1970](https://www.ruby-forum.com/u/loominator1970)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 11:04pm UTC](https://www.ruby-forum.com/t/trouble-passing-id-of-one-model-to-another-model/130617 "2008-02-29T23:04:59Z")

</div>

Hello, I’m having trouble workign with two models, specifically passing the id of my “Tools” model to New controller of my task model. I am creating a page that keeps track of tools we are building in our group. For…

---

## [Struggling with a socket problem](https://www.ruby-forum.com/t/struggling-with-a-socket-problem/130625)

<div class="topic-metadata">

**Author:** [@ratcheer](https://www.ruby-forum.com/u/ratcheer)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/struggling-with-a-socket-problem/130625 "2008-02-29T22:47:21Z")

</div>

Hi, Please can someone tell me if this is even possible, I’ve been trying to come up with various solutions and none of them seem to work. I have a model which can send UDP packets, these need to be sent over a speci…

---

## [Instructions for running SQLServer AR adapter unit tests](https://www.ruby-forum.com/t/instructions-for-running-sqlserver-ar-adapter-unit-tests/130601)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 1\
**Last updated:** [February 29, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/instructions-for-running-sqlserver-ar-adapter-unit-tests/130601 "2008-02-29T22:30:51Z")

</div>

I would like to submit a patch for the SQLServer AR adapter. In order to do that, I would like to run the unit tests. I read the “RUNNING\_UNIT\_TESTS” file in the SQL Server adapter distribution, and I’m not exactly su…

---

## [RJS and EXTjs component update (RAILS 1.2.3)](https://www.ruby-forum.com/t/rjs-and-extjs-component-update-rails-1-2-3/130622)

<div class="topic-metadata">

**Author:** [@kevin\_cline](https://www.ruby-forum.com/u/kevin_cline)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/rjs-and-extjs-component-update-rails-1-2-3/130622 "2008-02-29T22:30:48Z")

</div>

I want to use an RJS view to update EXT Panel bodies. But since the panel bodies have generated element ids, I can’t see how to use ‘page.replace\_html’. So instead I wrote a javascript function ‘updateBody’. In the…

---

## [Persistence as a mix-in rather than inherited behaviour](https://www.ruby-forum.com/t/persistence-as-a-mix-in-rather-than-inherited-behaviour/130616)

<div class="topic-metadata">

**Author:** [@sinclair](https://www.ruby-forum.com/u/sinclair)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 9:54pm UTC](https://www.ruby-forum.com/t/persistence-as-a-mix-in-rather-than-inherited-behaviour/130616 "2008-02-29T21:54:06Z")

</div>

Hi, Has anyone seen any projects or talk about implementing persistence in rails as a mix-in rather than by inheriting from AR::B ? class MyBase end class MyModel \< MyBase include ActiveRecord::Persistable end cl…

---

## [Unit Testing behavior](https://www.ruby-forum.com/t/unit-testing-behavior/130598)

<div class="topic-metadata">

**Author:** [@jay](https://www.ruby-forum.com/u/jay)\
**Replies:** 3\
**Last updated:** [February 29, 2008, 9:31pm UTC](https://www.ruby-forum.com/t/unit-testing-behavior/130598 "2008-02-29T21:31:05Z")

</div>

Hi, I’m relatively new to Ruby and Rails. We are using it at work and running in a TDD/continuous integration environment. I am getting some functional tests failing. We have a UserController and have the basic REST…

---

## [Sharing folders between RoR projects](https://www.ruby-forum.com/t/sharing-folders-between-ror-projects/130509)

<div class="topic-metadata">

**Author:** [@wintermute123](https://www.ruby-forum.com/u/wintermute123)\
**Replies:** 6\
**Last updated:** [February 29, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/sharing-folders-between-ror-projects/130509 "2008-02-29T20:49:38Z")

</div>

Greetings! I am working on a small RoR project and decided to split the front-end and the admin portion into two separate RoR projects. The project is a typical e-commerce website and as such has a folder to keep the …

---

## [Finding parent records without has\_many :through association](https://www.ruby-forum.com/t/finding-parent-records-without-has-many-through-association/130608)

<div class="topic-metadata">

**Author:** [@bcm](https://www.ruby-forum.com/u/bcm)\
**Replies:** 8\
**Last updated:** [February 29, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/finding-parent-records-without-has-many-through-association/130608 "2008-02-29T20:27:48Z")

</div>

Hi all, Here’s an interesting problem. I’ve got a reasonably complex set of models to represent a college campus housing lottery. class Dorm has\_many :rooms has\_many :room\_assignments, :through =\> :rooms end clas…

---

## [Change drop down list to radio buttons](https://www.ruby-forum.com/t/change-drop-down-list-to-radio-buttons/130469)

<div class="topic-metadata">

**Author:** [@Eva](https://www.ruby-forum.com/u/Eva)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 8:01pm UTC](https://www.ruby-forum.com/t/change-drop-down-list-to-radio-buttons/130469 "2008-02-29T20:01:19Z")

</div>

In my RoR app I would like to change a drop down list, which dispays a list of colors selected from the database. Instead I would like to create a radio button for each color. The user is allowed to check one color an…

---

## [Acts\_as\_readonlyable in production?](https://www.ruby-forum.com/t/acts-as-readonlyable-in-production/130610)

<div class="topic-metadata">

**Author:** [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 7:57pm UTC](https://www.ruby-forum.com/t/acts-as-readonlyable-in-production/130610 "2008-02-29T19:57:48Z")

</div>

Is anyone else using acts\_as\_readonlyable in production? We have been using it in production for a few months now, but only recently got a problem where 1 out of 100 inserts on one (out of 30+) tables is going to th…

---

## [Seeking Validation - search web service using memcached](https://www.ruby-forum.com/t/seeking-validation-search-web-service-using-memcached/130607)

<div class="topic-metadata">

**Author:** [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/seeking-validation-search-web-service-using-memcached/130607 "2008-02-29T19:18:16Z")

</div>

Hi, I’m looking for some validation for some work I’ve done for a client, and I’m open to criticism (“mock me” ? ;^), relevant awareness of similar projects, and alternatives. When I looked around in about September…

---

## [Button\_to\_function with text and image](https://www.ruby-forum.com/t/button-to-function-with-text-and-image/130274)

<div class="topic-metadata">

**Author:** [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 7:14pm UTC](https://www.ruby-forum.com/t/button-to-function-with-text-and-image/130274 "2008-02-29T19:14:45Z")

</div>

Hi, Is there a way to have text as well as image u the button\_to\_function. \<%= button\_to\_function “Cancel” , “#{remote\_function()}”%\> I have something like this and now i want the cancel should also have some text wi…

---

## [Does overwrite\_params ignore routing priority?](https://www.ruby-forum.com/t/does-overwrite-params-ignore-routing-priority/130603)

<div class="topic-metadata">

**Author:** [@James\_Ravn](https://www.ruby-forum.com/u/James_Ravn)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/does-overwrite-params-ignore-routing-priority/130603 "2008-02-29T18:47:33Z")

</div>

My routes.rb looks like this: map.resources :programs, :member =\> { :arrivals =\> :get } map.connect ‘:controller/:action/:id’ map.connect ‘:controller/:action/:id.:format’ Running ‘rake routes’ (omitting some of the …

---

## [SystemStackError (stack level too deep) when creating new AR](https://www.ruby-forum.com/t/systemstackerror-stack-level-too-deep-when-creating-new-ar/68408)

<div class="topic-metadata">

**Author:** [@Arsen7](https://www.ruby-forum.com/u/Arsen7)\
**Replies:** 1\
**Last updated:** [February 29, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/systemstackerror-stack-level-too-deep-when-creating-new-ar/68408 "2008-02-29T17:57:17Z")

</div>

Hi. I have a problem with very deep calls, causing SystemStackError. The logs are on Parked at Loopia It scares me, because I don’t understand it’s cause, and I fear it may strike on production (in case it disappears …

---

## [SQL Server & Rails 2.0 error -- MissingSourceFile](https://www.ruby-forum.com/t/sql-server-rails-2-0-error-missingsourcefile/130583)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 1\
**Last updated:** [February 29, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/sql-server-rails-2-0-error-missingsourcefile/130583 "2008-02-29T17:51:09Z")

</div>

Hallo – I’ve installed the activerecord-sqlserver-adapter gem, but I’m still getting an error when trying to connect to a SQL Server database that I was connecting to just fine before I upgraded. Can anyone help me fi…

---

## [Is SQL Server not supported in RoR on the Mac?](https://www.ruby-forum.com/t/is-sql-server-not-supported-in-ror-on-the-mac/130596)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/is-sql-server-not-supported-in-ror-on-the-mac/130596 "2008-02-29T17:49:10Z")

</div>

Hi – I’ve been having problems connecting to a SQL Server database that I thought might be related to the fact I was upgrading Rails to 2.0. However, I also was moving the project to my shiny new macbook. Anyway, afte…

---

## [Rendering a string](https://www.ruby-forum.com/t/rendering-a-string/130595)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/rendering-a-string/130595 "2008-02-29T17:38:11Z")

</div>

I have this string that get constructed in my controller - a link. Then in my view I use that link - which I have stored in a varibale, as the action for a link\_to helper. The problem is that some of the characters g…

---

## [Rendering a string](https://www.ruby-forum.com/t/rendering-a-string/187411)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/rendering-a-string/187411 "2008-02-29T17:38:11Z")

</div>

I have this string that get constructed in my controller - a link. Then in my view I use that link - which I have stored in a varibale, as the action for a link\_to helper. The problem is that some of the characters g…

---

## [Looking for RoR developers in Cincinnati area](https://www.ruby-forum.com/t/looking-for-ror-developers-in-cincinnati-area/130592)

<div class="topic-metadata">

**Author:** [@BridgeWorksS\_Inc](https://www.ruby-forum.com/u/BridgeWorksS_Inc)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 5:29pm UTC](https://www.ruby-forum.com/t/looking-for-ror-developers-in-cincinnati-area/130592 "2008-02-29T17:29:27Z")

</div>

BridgeWorks, Inc. has an immediate need for a RoR developer. This need is short-term, initially but could turn into a long-term relationship if the right candidate is found. The ideal candidate has: 1+ years o…

---

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

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 5\
**Last updated:** [February 29, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/model/130457 "2008-02-29T17:21:08Z")

</div>

I have two tables. They are Service Desk and Incident. I have to relate one of my service desk records with one or more service desk record(s) and/or one or more incident record(s). Hence the result of my search …

---

## [Nested resources and scoped ActiveRecord calls](https://www.ruby-forum.com/t/nested-resources-and-scoped-activerecord-calls/130280)

<div class="topic-metadata">

**Author:** [@bryan82](https://www.ruby-forum.com/u/bryan82)\
**Replies:** 5\
**Last updated:** [February 29, 2008, 5:18pm UTC](https://www.ruby-forum.com/t/nested-resources-and-scoped-activerecord-calls/130280 "2008-02-29T17:18:11Z")

</div>

Ok, I’ve got a nested resource, set up like so: map.resources :users, :has\_one =\> :profile When I create a user, I’m using this route to go the new profile page: new\_user\_profile\_path(@user) I’m my Profiles controlle…

---

## [Convert between two AssociationProxies](https://www.ruby-forum.com/t/convert-between-two-associationproxies/130487)

<div class="topic-metadata">

**Author:** [@Ivan\_Ukhov](https://www.ruby-forum.com/u/Ivan_Ukhov)\
**Replies:** 5\
**Last updated:** [February 29, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/convert-between-two-associationproxies/130487 "2008-02-29T17:15:12Z")

</div>

Hello There’s a polymorphic association Person -\> Adult. There’s an AssociationProxy array of Adult, how to convert this proxy of Person to corresponding AssociationProxy of Adult? Thanks

---

## [Dealing with MySQL disconnects on long running scripts](https://www.ruby-forum.com/t/dealing-with-mysql-disconnects-on-long-running-scripts/130576)

<div class="topic-metadata">

**Author:** [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/dealing-with-mysql-disconnects-on-long-running-scripts/130576 "2008-02-29T17:04:39Z")

</div>

Would anyone happen to have some advise for this? I have a script that runs for months at a time. On one box, I can do this without issue, on another it disconnects after a day. I’ve been trying various solutions, bu…

---

## [Preventing Someone From Inserting Certain Tags Within A Field](https://www.ruby-forum.com/t/preventing-someone-from-inserting-certain-tags-within-a-field/130585)

<div class="topic-metadata">

**Author:** [@johnk](https://www.ruby-forum.com/u/johnk)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 4:48pm UTC](https://www.ruby-forum.com/t/preventing-someone-from-inserting-certain-tags-within-a-field/130585 "2008-02-29T16:48:40Z")

</div>

I have seen this before but I can’t seem to find it now. Can anyone suggest a plugin or gem that validates that certain fields don’t include certain tags or only include certain tags? :slight\_smile: Thanks! …

---

## [Deleting params so overwrite\_params doesn't include it](https://www.ruby-forum.com/t/deleting-params-so-overwrite-params-doesnt-include-it/81414)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 1\
**Last updated:** [February 29, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/deleting-params-so-overwrite-params-doesnt-include-it/81414 "2008-02-29T16:46:51Z")

</div>

Hi all, I’m trying to delete params in the controller so that in the view, when I call overwrite\_params it doesn’t include it. I think I’ve tried pretty much everything. Here is an example of what I mean: For url /c…

---

## [Cn w update the two tables under one action ...both are in one to one relation](https://www.ruby-forum.com/t/cn-w-update-the-two-tables-under-one-action-both-are-in-one-to-one-relation/130567)

<div class="topic-metadata">

**Author:** [@joe](https://www.ruby-forum.com/u/joe)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/cn-w-update-the-two-tables-under-one-action-both-are-in-one-to-one-relation/130567 "2008-02-29T16:31:47Z")

</div>

i hav tried this thng…but it s coming to the else part. class Article \< ActiveRecord::Base belongs\_to :category end class Category \< ActiveRecord::Base has\_one :article end def update @article = Category.new @ar…

---

## [Has\_many: through, :class\_name, :foreign\_key](https://www.ruby-forum.com/t/has-many-through-class-name-foreign-key/130561)

<div class="topic-metadata">

**Author:** [@Ivan\_Ukhov](https://www.ruby-forum.com/u/Ivan_Ukhov)\
**Replies:** 1\
**Last updated:** [February 29, 2008, 4:20pm UTC](https://www.ruby-forum.com/t/has-many-through-class-name-foreign-key/130561 "2008-02-29T16:20:43Z")

</div>

Hello! When we use has\_many :through, is there a way to specify the name of the class and the foreign key? This question pops up when the join table has fields that are not named according to names of the joinable ta…

---

## [Find() not returning value of dynamically renamed field](https://www.ruby-forum.com/t/find-not-returning-value-of-dynamically-renamed-field/130560)

<div class="topic-metadata">

**Author:** [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 4:02pm UTC](https://www.ruby-forum.com/t/find-not-returning-value-of-dynamically-renamed-field/130560 "2008-02-29T16:02:37Z")

</div>

Hi, I have a database table, containing a large number of fields, among which a bunch of i18n fields, like DESC\_EN, DESC\_FR, DESC\_DE, etc. I would like to dynamically select which one of these fields I will return, b…

---

## [Flexible Rails problem](https://www.ruby-forum.com/t/flexible-rails-problem/130575)

<div class="topic-metadata">

**Author:** [@Beselga](https://www.ruby-forum.com/u/Beselga)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 3:09pm UTC](https://www.ruby-forum.com/t/flexible-rails-problem/130575 "2008-02-29T15:09:50Z")

</div>

Hello everybody, i’m reading the book Flexible Rails, i’m in page 122 of the pdf, but the login page is not working, the error it gives when i try to login: \[RPC Fault faultString=“HTTP request error” faultCode=“Serv…

---

## [How to DRY REST admin path in URLs?](https://www.ruby-forum.com/t/how-to-dry-rest-admin-path-in-urls/130558)

<div class="topic-metadata">

**Author:** [@yannis](https://www.ruby-forum.com/u/yannis)\
**Replies:** 3\
**Last updated:** [February 29, 2008, 2:15pm UTC](https://www.ruby-forum.com/t/how-to-dry-rest-admin-path-in-urls/130558 "2008-02-29T14:15:16Z")

</div>

Hi everyone… For almost all of my objects I put a series of classic REST admin links in views. For example, for a ‘user’, I have \<%= link\_to “Show”, user\_path(user) %\> \<%= link\_to “Edit”, edit\_user\_path(user) %\> \<%=…

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

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