# Rails

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

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

---

## [Displaying objects in an array](https://www.ruby-forum.com/t/displaying-objects-in-an-array/117451)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 1\
**Last updated:** [October 17, 2007, 12:50am UTC](https://www.ruby-forum.com/t/displaying-objects-in-an-array/117451 "2007-10-17T00:50:13Z")

</div>

Hi, I am a bit confused on exactly how this works out. I have ObjectA which has\_many :things and Thing belongs\_to :object\_a So, what I want to do is display all the things that ObjectA has in a text\_area. When I have …

---

## [Submit Form with AJAX on javascript event](https://www.ruby-forum.com/t/submit-form-with-ajax-on-javascript-event/117448)

<div class="topic-metadata">

**Author:** [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 12:25am UTC](https://www.ruby-forum.com/t/submit-form-with-ajax-on-javascript-event/117448 "2007-10-17T00:25:20Z")

</div>

I’m new to rjs and ajax…doing the example in RJS Templates for rails. I’d like to submit the form onChange…but my onChange code doesn’t work as expected. I get the js code in the browser window…instead of my updated …

---

## [Extend ActiveRecord::Base with a public\_content\_columns()?](https://www.ruby-forum.com/t/extend-activerecord-base-with-a-public-content-columns/117444)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 1\
**Last updated:** [October 16, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/extend-activerecord-base-with-a-public-content-columns/117444 "2007-10-16T23:38:56Z")

</div>

Hi all I have added the following code to my application.rb: class ActiveRecord::Base def public\_content\_columns content\_columns.reject{|column| \[‘created\_at’, ‘updated\_at’, ‘lock\_version’\].include?(column.name)} e…

---

## [ActiveRecord: find\_or\_create with has\_and\_belongs\_to\_many --](https://www.ruby-forum.com/t/activerecord-find-or-create-with-has-and-belongs-to-many/102826)

<div class="topic-metadata">

**Author:** [@Red\_Daly](https://www.ruby-forum.com/u/Red_Daly)\
**Replies:** 1\
**Last updated:** [October 16, 2007, 10:33pm UTC](https://www.ruby-forum.com/t/activerecord-find-or-create-with-has-and-belongs-to-many/102826 "2007-10-16T22:33:48Z")

</div>

I am attempting to use find\_or\_create on a foreign table with a has\_and\_belongs\_to\_many relationship with my current table. I am doing the following: term = school.terms.find\_or\_create\_by\_code(“FALL06”) the queries …

---

## [Helper method for facade column](https://www.ruby-forum.com/t/helper-method-for-facade-column/117396)

<div class="topic-metadata">

**Author:** [@spike666](https://www.ruby-forum.com/u/spike666)\
**Replies:** 4\
**Last updated:** [October 16, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/helper-method-for-facade-column/117396 "2007-10-16T21:58:31Z")

</div>

Hey everyone, I’ve got a facade column set up in 2 of my models. Specifically, I’m storing an IPv4 address as a 32-bit integer in my database and my model is set up to only return the IP in dotted notation (ie: 176942…

---

## [The best resource for the best Rails patterns and practices?](https://www.ruby-forum.com/t/the-best-resource-for-the-best-rails-patterns-and-practices/117064)

<div class="topic-metadata">

**Author:** [@gavin](https://www.ruby-forum.com/u/gavin)\
**Replies:** 10\
**Last updated:** [October 16, 2007, 9:47pm UTC](https://www.ruby-forum.com/t/the-best-resource-for-the-best-rails-patterns-and-practices/117064 "2007-10-16T21:47:25Z")

</div>

Hi Can I get everyone with an opinion to reply with what they think is the best resource for Rails patterns and practices? Thanks Gavin

---

## [Alternatives to Typo](https://www.ruby-forum.com/t/alternatives-to-typo/117431)

<div class="topic-metadata">

**Author:** [@creativelogic](https://www.ruby-forum.com/u/creativelogic)\
**Replies:** 1\
**Last updated:** [October 16, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/alternatives-to-typo/117431 "2007-10-16T21:02:23Z")

</div>

Are there any Rails alternatives to Typo? I have been working on it for the past couple months with very little success. I’m not doing anything crazy, but it keep crashing, has slow response times, the administrati…

---

## [Array statistics](https://www.ruby-forum.com/t/array-statistics/117299)

<div class="topic-metadata">

**Author:** [@predhme](https://www.ruby-forum.com/u/predhme)\
**Replies:** 1\
**Last updated:** [October 16, 2007, 8:00pm UTC](https://www.ruby-forum.com/t/array-statistics/117299 "2007-10-16T20:00:18Z")

</div>

I built a view that includes a form\_remote\_tag that will take user input and dynamically generate a table list of requested items. The user can change the input to display different results. The data is modeled simila…

---

## [Redirects with mongrel (dropping the www. from a url)](https://www.ruby-forum.com/t/redirects-with-mongrel-dropping-the-www-from-a-url/117426)

<div class="topic-metadata">

**Author:** [@dodgyboz](https://www.ruby-forum.com/u/dodgyboz)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 7:54pm UTC](https://www.ruby-forum.com/t/redirects-with-mongrel-dropping-the-www-from-a-url/117426 "2007-10-16T19:54:28Z")

</div>

Hi All, I have a rails app running on an apache virtual host with mongrel that i want to set up a redirect from www.myapp.com to myapp.com (dropping the www.) I have tried doing this in apache using a rewrite rule (b…

---

## [Automatic form tag helpers given the attribute type](https://www.ruby-forum.com/t/automatic-form-tag-helpers-given-the-attribute-type/117425)

<div class="topic-metadata">

**Author:** [@emmanueloga](https://www.ruby-forum.com/u/emmanueloga)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 7:49pm UTC](https://www.ruby-forum.com/t/automatic-form-tag-helpers-given-the-attribute-type/117425 "2007-10-16T19:49:07Z")

</div>

Hi. I need to get the apropiate tag helper given a resource attribute. I’m pretty much sure rails already has something to do this, but i don’t remember where. My ugly solution is this: def standard\_form\_method form, …

---

## [Best solution for accessing multiple databases?](https://www.ruby-forum.com/t/best-solution-for-accessing-multiple-databases/117415)

<div class="topic-metadata">

**Author:** [@matt](https://www.ruby-forum.com/u/matt)\
**Replies:** 3\
**Last updated:** [October 16, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/best-solution-for-accessing-multiple-databases/117415 "2007-10-16T19:20:09Z")

</div>

Good morning, I’m currently running my Rails app out of PostgreSQL database but I’ve gotten to a point where I need to query another Oracle database to retrieve a single record. I’ve seen approaches like this: http:…

---

## [How to change a scope of the accessor in model?](https://www.ruby-forum.com/t/how-to-change-a-scope-of-the-accessor-in-model/117422)

<div class="topic-metadata">

**Author:** [@Nikolay\_P](https://www.ruby-forum.com/u/Nikolay_P)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 7:02pm UTC](https://www.ruby-forum.com/t/how-to-change-a-scope-of-the-accessor-in-model/117422 "2007-10-16T19:02:18Z")

</div>

Hello all. I have a table “Account” with the “value” column. How i can change a scope for it, so that is will be only accessable in a Account class? I’ve tried to overload a method, but no luck: class Account \< Act…

---

## [Boolean trouble](https://www.ruby-forum.com/t/boolean-trouble/117398)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [October 16, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/boolean-trouble/117398 "2007-10-16T18:15:29Z")

</div>

rails recognized a tinyint(1) in mysql as a boolean value, so a model.boolean = true writes a one, however a model.boolean = false writes nothing, how can I write a zero? if I do model.boolean = 0 it does not write an…

---

## [Look at this great site](https://www.ruby-forum.com/t/look-at-this-great-site/117416)

<div class="topic-metadata">

**Author:** [@maddin](https://www.ruby-forum.com/u/maddin)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 6:09pm UTC](https://www.ruby-forum.com/t/look-at-this-great-site/117416 "2007-10-16T18:09:02Z")

</div>

http://spielwelt6.knightfight.de/?ac=vid&vid=121044096

---

## [Using multiple foreign keys in views](https://www.ruby-forum.com/t/using-multiple-foreign-keys-in-views/117400)

<div class="topic-metadata">

**Author:** [@daveamos](https://www.ruby-forum.com/u/daveamos)\
**Replies:** 8\
**Last updated:** [October 16, 2007, 5:44pm UTC](https://www.ruby-forum.com/t/using-multiple-foreign-keys-in-views/117400 "2007-10-16T17:44:24Z")

</div>

I have a model, Game, that has\_many :teams. There’s a home team and an away team. I created two foreign keys, so each game can have two teams associated with it. Here’s the Team model: class Team \< ActiveRecord::Base …

---

## [Firefox, nginx, and a redirect](https://www.ruby-forum.com/t/firefox-nginx-and-a-redirect/117413)

<div class="topic-metadata">

**Author:** [@whitewolfaustria](https://www.ruby-forum.com/u/whitewolfaustria)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/firefox-nginx-and-a-redirect/117413 "2007-10-16T17:39:43Z")

</div>

Hi all, Well deploying my application I have come across across a problem. I have an IndexController with a method def index redirect\_to :controller =\> “index” end On IE I get the responce I want, The page immedie…

---

## [Text format - show breaks](https://www.ruby-forum.com/t/text-format-show-breaks/117407)

<div class="topic-metadata">

**Author:** [@dgm](https://www.ruby-forum.com/u/dgm)\
**Replies:** 3\
**Last updated:** [October 16, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/text-format-show-breaks/117407 "2007-10-16T17:36:47Z")

</div>

How do I make a post to a blog format with the same breaks the user added? for example: the user typed in: 'Hello This is a post’ And my output is like this: ‘Hello This is a post’ How do I format it with the co…

---

## [Columns reload problem when table changes](https://www.ruby-forum.com/t/columns-reload-problem-when-table-changes/117408)

<div class="topic-metadata">

**Author:** [@nick](https://www.ruby-forum.com/u/nick)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/columns-reload-problem-when-table-changes/117408 "2007-10-16T17:26:47Z")

</div>

hi, all I have a problem when I use Table.content\_columns, the result returned is just old columns, any new column which are added by add\_column would not show up. but actual content i added can be access by using co…

---

## [Redirect\_to an :anchor not working](https://www.ruby-forum.com/t/redirect-to-an-anchor-not-working/117247)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 5\
**Last updated:** [October 16, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/redirect-to-an-anchor-not-working/117247 "2007-10-16T17:05:43Z")

</div>

In my noddy blog app I want to not have to scroll back down after deleting an entry. I first tried using Javascript scrollTop in the view, but I could not find a way of passing the value to the controller so that I c…

---

## [Apply more than one condition to find(:all)](https://www.ruby-forum.com/t/apply-more-than-one-condition-to-find-all/117393)

<div class="topic-metadata">

**Author:** [@ratschi85](https://www.ruby-forum.com/u/ratschi85)\
**Replies:** 6\
**Last updated:** [October 16, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/apply-more-than-one-condition-to-find-all/117393 "2007-10-16T16:55:12Z")

</div>

Hey, I have got an action that should retrieve all rows where the created\_at column matches the current date, but I want another condition in there saying that the column parent\_id should equal to nil (:parent\_id =\> …

---

## [Drop down lists](https://www.ruby-forum.com/t/drop-down-lists/117395)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/drop-down-lists/117395 "2007-10-16T16:28:13Z")

</div>

What’s the ActionView method to use for a simple Yes/No dropdownlist and how do I check if the user selected yes, then yes=1 and no=nil?

---

## [Rails and db4o](https://www.ruby-forum.com/t/rails-and-db4o/117391)

<div class="topic-metadata">

**Author:** [@gerpux](https://www.ruby-forum.com/u/gerpux)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 4:21pm UTC](https://www.ruby-forum.com/t/rails-and-db4o/117391 "2007-10-16T16:21:12Z")

</div>

Hi! There’s a project for porting db4o (it’s an open source object database) to Ruby called db4ro (http://developer.db4o.com/ ProjectSpaces/view.aspx/Tools\_And\_Add-Ons/ Language\_Bindings\_or\_Implementations). I wonder…

---

## [Serious problem with caching with multiple mongrels?](https://www.ruby-forum.com/t/serious-problem-with-caching-with-multiple-mongrels/117386)

<div class="topic-metadata">

**Author:** [@weepy](https://www.ruby-forum.com/u/weepy)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/serious-problem-with-caching-with-multiple-mongrels/117386 "2007-10-16T15:43:08Z")

</div>

Hi I ran into what seemed to be a very serious problem with the way caching works. However it seems so serious that I wonder if I’m missing something very obvious ! Essentially if you use a filestore and a fragment c…

---

## [Javascript](https://www.ruby-forum.com/t/javascript/196488)

<div class="topic-metadata">

**Author:** [@crazybass](https://www.ruby-forum.com/u/crazybass)\
**Replies:** 2\
**Last updated:** [October 16, 2007, 3:36pm UTC](https://www.ruby-forum.com/t/javascript/196488 "2007-10-16T15:36:42Z")

</div>

Hello I have a controller which executes a “render :partial” to actualise part of my web page (a object). When I do that I would like to call a javascript function to complete my process. How can I do that? Anyone…

---

## [Problem retrieving user id](https://www.ruby-forum.com/t/problem-retrieving-user-id/117371)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [October 16, 2007, 3:29pm UTC](https://www.ruby-forum.com/t/problem-retrieving-user-id/117371 "2007-10-16T15:29:03Z")

</div>

I have a problem, I use a find.params\[:id\] to display a user from a list, and then I want to edit that information. I have a separate action for the edit, named change\_user\_details, and I retrieve the user id the same…

---

## [Writing Unicode to MS Sql on Linux](https://www.ruby-forum.com/t/writing-unicode-to-ms-sql-on-linux/117382)

<div class="topic-metadata">

**Author:** [@JTJTJT](https://www.ruby-forum.com/u/JTJTJT)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/writing-unicode-to-ms-sql-on-linux/117382 "2007-10-16T14:26:55Z")

</div>

Following the instructions on getting Rails to work with MS Sql on Linux worked as far as reading unicode data from the database. However, when I tried to write UTF-8 data that is non english the data became a series …

---

## [How to connect to Intranet Server using Ruby](https://www.ruby-forum.com/t/how-to-connect-to-intranet-server-using-ruby/117375)

<div class="topic-metadata">

**Author:** [@Piyushg](https://www.ruby-forum.com/u/Piyushg)\
**Replies:** 0\
**Last updated:** [October 16, 2007, 1:33pm UTC](https://www.ruby-forum.com/t/how-to-connect-to-intranet-server-using-ruby/117375 "2007-10-16T13:33:31Z")

</div>

Hi , I have my application on two different servers text drive server 2 intranet server located at some place. Right now i am using VPN to access my application that is on intranet server. Now i need to connect t…

---

## [Havin problem with set the flag in loop](https://www.ruby-forum.com/t/havin-problem-with-set-the-flag-in-loop/117358)

<div class="topic-metadata">

**Author:** [@vidyagayathri](https://www.ruby-forum.com/u/vidyagayathri)\
**Replies:** 2\
**Last updated:** [October 16, 2007, 12:49pm UTC](https://www.ruby-forum.com/t/havin-problem-with-set-the-flag-in-loop/117358 "2007-10-16T12:49:51Z")

</div>

Hi all, I am having problem with array while setting the flag, actaully when i get the array size should be all 44 other wise it should come to flag 0, now my array counts are 42 42 44, so it shows the flag = 0, but …

---

## [Sanitizing HTML in a model?](https://www.ruby-forum.com/t/sanitizing-html-in-a-model/117293)

<div class="topic-metadata">

**Author:** [@fxp](https://www.ruby-forum.com/u/fxp)\
**Replies:** 8\
**Last updated:** [October 16, 2007, 12:16pm UTC](https://www.ruby-forum.com/t/sanitizing-html-in-a-model/117293 "2007-10-16T12:16:26Z")

</div>

I’m making a messaging application and am wondering if there’s a way to do HTML sanitization in the model instead of in the view. My application accepts a message from the user, which must then be sanitized before it’…

---

## [Active Record associations wiredness](https://www.ruby-forum.com/t/active-record-associations-wiredness/117235)

<div class="topic-metadata">

**Author:** [@dueckes](https://www.ruby-forum.com/u/dueckes)\
**Replies:** 3\
**Last updated:** [October 16, 2007, 11:23am UTC](https://www.ruby-forum.com/t/active-record-associations-wiredness/117235 "2007-10-16T11:23:41Z")

</div>

Hi all, Can anyone explain why line 1372 of lib/active\_record/ associations.rb performs a String equality check as opposed to a more conventional Object equality check: return nil if record.id.to\_s != join.parent.rec…

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

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