# Rails

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

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

---

## [Declaring property variable](https://www.ruby-forum.com/t/declaring-property-variable/121530)

<div class="topic-metadata">

**Author:** [@backz](https://www.ruby-forum.com/u/backz)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 7:00pm UTC](https://www.ruby-forum.com/t/declaring-property-variable/121530 "2007-11-28T19:00:36Z")

</div>

Hi, I have this in development.rb my\_path = { :test\_path\_dev =\> ‘http test’ } and trying to retrieve in controller and inside of javascript function. How do I do that? thx,

---

## [Campfire like chat plugin?](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [November 28, 2007, 6:34pm UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962 "2007-11-28T18:34:17Z")

</div>

I’ve got to write a little app at work for doctors and med students to view a streaming video feed, and the users want the ability to have a chat window. I’ve got everything else figured out, authentication, the strea…

---

## [How to insert conditional in a rjs file](https://www.ruby-forum.com/t/how-to-insert-conditional-in-a-rjs-file/121522)

<div class="topic-metadata">

**Author:** [@altrugon](https://www.ruby-forum.com/u/altrugon)\
**Replies:** 3\
**Last updated:** [November 28, 2007, 6:29pm UTC](https://www.ruby-forum.com/t/how-to-insert-conditional-in-a-rjs-file/121522 "2007-11-28T18:29:58Z")

</div>

Hi, I’m following the book Agile Web D. with Rails and I have finished to implement the action â€œremove\_from\_cartâ€ which is one of the task in the Playtime section of page 139. Everything works well; I highlight t…

---

## [Anything wrong with this? am I just making trouble?](https://www.ruby-forum.com/t/anything-wrong-with-this-am-i-just-making-trouble/121520)

<div class="topic-metadata">

**Author:** [@uncle](https://www.ruby-forum.com/u/uncle)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/anything-wrong-with-this-am-i-just-making-trouble/121520 "2007-11-28T18:15:31Z")

</div>

I have included this extension to Hash in my rails app… class Hash def method\_missing(name, value=nil) key = name.to\_s.sub(/\[=?!\]$/,’’).to\_sym self\[key\] = value if name.to\_s\[-1,1\] == “=” return self\[key\] end end I…

---

## [Build file? install rails app?](https://www.ruby-forum.com/t/build-file-install-rails-app/121524)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 6:14pm UTC](https://www.ruby-forum.com/t/build-file-install-rails-app/121524 "2007-11-28T18:14:56Z")

</div>

In java ANT is used to build java applications. For a RoR application, is there anything which does remotely the same thing? Because I wanted a repeatable process I created a ruby script which: drops then creates th…

---

## [New to RonR](https://www.ruby-forum.com/t/new-to-ronr/121398)

<div class="topic-metadata">

**Author:** [@CaleLettus](https://www.ruby-forum.com/u/CaleLettus)\
**Replies:** 10\
**Last updated:** [November 28, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/new-to-ronr/121398 "2007-11-28T17:18:08Z")

</div>

Hello, I’ll try to keep this short BUT, I’ve got little/no experience with programming. In fact, my only background is using Cold Fusion (since 1996 and VERY little of that for the past 5 years as I’ve been playing a…

---

## [Finding non-empty associations](https://www.ruby-forum.com/t/finding-non-empty-associations/121513)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [November 28, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/finding-non-empty-associations/121513 "2007-11-28T17:12:16Z")

</div>

Using the Farmer/Cow example from the Pro Active Record book, assume the following: Farmers are related to Cows such that Farmers have\_many Cows and Cows belong\_to Farmers. That is, a plain old one-to-many association…

---

## [Double belongs to in AR?](https://www.ruby-forum.com/t/double-belongs-to-in-ar/121517)

<div class="topic-metadata">

**Author:** [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/double-belongs-to-in-ar/121517 "2007-11-28T16:55:15Z")

</div>

Can you do a double belongs to in ActiveRecord? I wanted a column made up of user ids matched with group ids (since I can’t think of a better way with my current knowledge of AR). Something like the following: class…

---

## [Model setters, override attribute=(attribute)?](https://www.ruby-forum.com/t/model-setters-override-attribute-attribute/121305)

<div class="topic-metadata">

**Author:** [@reynar](https://www.ruby-forum.com/u/reynar)\
**Replies:** 6\
**Last updated:** [November 28, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/model-setters-override-attribute-attribute/121305 "2007-11-28T16:48:44Z")

</div>

Hi, I have a model similar Basket shown below. If customer\_type is set then it should also set customer to nil. Likewise, if I set customer, it should inspect the customer\_type attached to the customer and set accord…

---

## [OpenHash class I thought I would share](https://www.ruby-forum.com/t/openhash-class-i-thought-i-would-share/121515)

<div class="topic-metadata">

**Author:** [@uncle](https://www.ruby-forum.com/u/uncle)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/openhash-class-i-thought-i-would-share/121515 "2007-11-28T16:44:01Z")

</div>

I love OpenStruct, but it has no ability to iterate over the members. I had extended it, but recently I use this little class. Anyone see any issues with it ? class OpenHash \< Hash def method\_missing(name, value=nil…

---

## [Javascript code blocks in RJS](https://www.ruby-forum.com/t/javascript-code-blocks-in-rjs/121464)

<div class="topic-metadata">

**Author:** [@boram](https://www.ruby-forum.com/u/boram)\
**Replies:** 3\
**Last updated:** [November 28, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/javascript-code-blocks-in-rjs/121464 "2007-11-28T16:44:01Z")

</div>

Hi all: I have a block of javascript that I want to use to clear out field notices in multiple forms on my site. The way I’m doing it now is to write directly to RJS like render :update do |page| page \<\< JS\_BLOCK e…

---

## [How can I connect with postgresql using rails?](https://www.ruby-forum.com/t/how-can-i-connect-with-postgresql-using-rails/121476)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/how-can-i-connect-with-postgresql-using-rails/121476 "2007-11-28T16:38:42Z")

</div>

Dear Friends, I am a new of ruby on rails. In my server mqsql is not installed,instead of mysql I am having the postgresql. How can I connect with postgresql using rails ? Please anyone help me to study further deta…

---

## [Replacing the database in Active Record with RPC-based interface](https://www.ruby-forum.com/t/replacing-the-database-in-active-record-with-rpc-based-interface/121502)

<div class="topic-metadata">

**Author:** [@Stefan\_Magnus\_Landr](https://www.ruby-forum.com/u/Stefan_Magnus_Landr)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/replacing-the-database-in-active-record-with-rpc-based-interface/121502 "2007-11-28T16:28:08Z")

</div>

Hi there, We’re about to move our persistent store from a MySQL database to an RPC-based data store. However, we really like programming against the AR-api, and would like to keep as much as possible from, so that we…

---

## [Multiple Tables for ONE location](https://www.ruby-forum.com/t/multiple-tables-for-one-location/121373)

<div class="topic-metadata">

**Author:** [@quigebo](https://www.ruby-forum.com/u/quigebo)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/multiple-tables-for-one-location/121373 "2007-11-28T16:03:26Z")

</div>

Hey, I was wondering how I should create my database. I am going to have a ‘location’ model, which has Address, State, Zip, Lat, Lng, Country and vaguely remember from one class a long time ago that each table should …

---

## [Stored Procedure problem on linux](https://www.ruby-forum.com/t/stored-procedure-problem-on-linux/121509)

<div class="topic-metadata">

**Author:** [@jagan](https://www.ruby-forum.com/u/jagan)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/stored-procedure-problem-on-linux/121509 "2007-11-28T15:50:31Z")

</div>

Hi, I am using storepocedures for mysql 5.0 on windows OS . I am running successfully after modifying the mysql\_adapter.rb with client\_multi\_session = 65536, and select\_sp method. Now , I have to deploy it on li…

---

## [How to find what Gems are Installed?](https://www.ruby-forum.com/t/how-to-find-what-gems-are-installed/121508)

<div class="topic-metadata">

**Author:** [@gemblon](https://www.ruby-forum.com/u/gemblon)\
**Replies:** 2\
**Last updated:** [November 28, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/how-to-find-what-gems-are-installed/121508 "2007-11-28T15:47:57Z")

</div>

This question may have been asked before, but I can’t find it. How do I find what gem’s are installed on my InstantRails on Windows? I found “gem dependency rails” but I am looking for all the GEMS installed on this …

---

## [Testing and Fixtures with relationships issue](https://www.ruby-forum.com/t/testing-and-fixtures-with-relationships-issue/121507)

<div class="topic-metadata">

**Author:** [@JesSSSSs](https://www.ruby-forum.com/u/JesSSSSs)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 3:42pm UTC](https://www.ruby-forum.com/t/testing-and-fixtures-with-relationships-issue/121507 "2007-11-28T15:42:54Z")

</div>

Hi, i just started in rails and i’m very stuck with a fixture issue. I’m trying to test my models, i have the following models: -user: tipical user -event: “something” with datetime and other things (for example, hol…

---

## [Variable visible in all actions of the controller](https://www.ruby-forum.com/t/variable-visible-in-all-actions-of-the-controller/121497)

<div class="topic-metadata">

**Author:** [@Hipnotik](https://www.ruby-forum.com/u/Hipnotik)\
**Replies:** 4\
**Last updated:** [November 28, 2007, 3:22pm UTC](https://www.ruby-forum.com/t/variable-visible-in-all-actions-of-the-controller/121497 "2007-11-28T15:22:23Z")

</div>

Hi I would like to have variable visible for all actions of one controller. It’s something like admin panel where I have some actions, such as ‘list’, ‘new’, ‘edit’ and I have to display at the top of the page logged…

---

## [Sending A mailinglist](https://www.ruby-forum.com/t/sending-a-mailinglist/121498)

<div class="topic-metadata">

**Author:** [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Replies:** 3\
**Last updated:** [November 28, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/sending-a-mailinglist/121498 "2007-11-28T15:16:25Z")

</div>

I’am building a app where users can describe for a mailinglist. But the problem is how can i send a list of mails def mailinglist(mail) @mailinglists = Mailinglist.find(:all) recipients @mailinglists.email from …

---

## [Net::HTTP reponse method - custom timeout](https://www.ruby-forum.com/t/net-http-reponse-method-custom-timeout/121492)

<div class="topic-metadata">

**Author:** [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Replies:** 2\
**Last updated:** [November 28, 2007, 3:02pm UTC](https://www.ruby-forum.com/t/net-http-reponse-method-custom-timeout/121492 "2007-11-28T15:02:13Z")

</div>

I am using the following code to control an external device via it’s in-built web server interface: def send\_to\_unit(instruction) begin if @address and http = Net::HTTP.new(@address, 80) http.start do |http| reques…

---

## [Capistrano hangs](https://www.ruby-forum.com/t/capistrano-hangs/121436)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/capistrano-hangs/121436 "2007-11-28T14:30:42Z")

</div>

Any idea why this command takes upwards of 15 minutes to complete? run “cd #{release\_path} && ORACLE\_HOME=/home/oracle RAILS\_ENV=production rake db:migrate” When running it against my local Postgres it completes in a …

---

## [Oracle legacy database with ISO-8859-1](https://www.ruby-forum.com/t/oracle-legacy-database-with-iso-8859-1/121390)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [November 28, 2007, 2:20pm UTC](https://www.ruby-forum.com/t/oracle-legacy-database-with-iso-8859-1/121390 "2007-11-28T14:20:42Z")

</div>

Hi, I ve got a legacy oracle database in ISO-8859-1 encoding, which is in use by other applications as well. Now, I would like to add a rails app for new features. Rails is using unicode so special characters are sto…

---

## [Redirecting back on errors to multi-form pages](https://www.ruby-forum.com/t/redirecting-back-on-errors-to-multi-form-pages/120611)

<div class="topic-metadata">

**Author:** [@tomn](https://www.ruby-forum.com/u/tomn)\
**Replies:** 8\
**Last updated:** [November 28, 2007, 2:14pm UTC](https://www.ruby-forum.com/t/redirecting-back-on-errors-to-multi-form-pages/120611 "2007-11-28T14:14:50Z")

</div>

I am struggling with error handling on forms when the data entered wont validate. The trick of using render instead of redirect doesn’t seem to work because my collection selects on the other forms on the page need i…

---

## [Aliases in ROR (for an instance)](https://www.ruby-forum.com/t/aliases-in-ror-for-an-instance/121366)

<div class="topic-metadata">

**Author:** [@harper](https://www.ruby-forum.com/u/harper)\
**Replies:** 2\
**Last updated:** [November 28, 2007, 2:04pm UTC](https://www.ruby-forum.com/t/aliases-in-ror-for-an-instance/121366 "2007-11-28T14:04:40Z")

</div>

hi, following situation: class Item \< ActiveRecord::Base alias :newmeth :oldmeth end if i do Item.newmeth # it returns :oldmeth – this is neat behavior, and it works great. but i was hoping to find out how to cha…

---

## [Dafault value of a textbox prompting user of what to enter](https://www.ruby-forum.com/t/dafault-value-of-a-textbox-prompting-user-of-what-to-enter/121494)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 1:47pm UTC](https://www.ruby-forum.com/t/dafault-value-of-a-textbox-prompting-user-of-what-to-enter/121494 "2007-11-28T13:47:03Z")

</div>

Hi, I want to create a textbox that will have default text like "enter author, title or ISDN number " which dissapears of when user types in something. Is there default attribute in rails for this? Or DO I need to go…

---

## [Detect environment in migration](https://www.ruby-forum.com/t/detect-environment-in-migration/121467)

<div class="topic-metadata">

**Author:** [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Replies:** 1\
**Last updated:** [November 28, 2007, 1:29pm UTC](https://www.ruby-forum.com/t/detect-environment-in-migration/121467 "2007-11-28T13:29:58Z")

</div>

We’re using migrations for generating our test schemas (for a whole load of reasons) and need to specifically run code when we are running our rspec tests as opposed to running the actual migrations on the production …

---

## [Odbc-rails gem installation problem](https://www.ruby-forum.com/t/odbc-rails-gem-installation-problem/121493)

<div class="topic-metadata">

**Author:** [@GPB](https://www.ruby-forum.com/u/GPB)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 1:27pm UTC](https://www.ruby-forum.com/t/odbc-rails-gem-installation-problem/121493 "2007-11-28T13:27:51Z")

</div>

Hello… I install the odbc-rails gem by running: gem install -r odbc-rails --include-dependencies Then I add require ‘odbc\_adapter’ to my config/environment.rb When I start the server I get this beauty… C:/ruby/lib/…

---

## [Passing Query String while doing http authentication](https://www.ruby-forum.com/t/passing-query-string-while-doing-http-authentication/90265)

<div class="topic-metadata">

**Author:** [@kiran](https://www.ruby-forum.com/u/kiran)\
**Replies:** 2\
**Last updated:** [November 28, 2007, 1:15pm UTC](https://www.ruby-forum.com/t/passing-query-string-while-doing-http-authentication/90265 "2007-11-28T13:15:34Z")

</div>

Hi, I am trying to read content of url after doing http authentication. using the below code query string(UserID=1) is not passed properly in the request. I am new to ruby so please let me know what are the changes …

---

## [Help with "will\_paginate"](https://www.ruby-forum.com/t/help-with-will-paginate/121486)

<div class="topic-metadata">

**Author:** [@kilo](https://www.ruby-forum.com/u/kilo)\
**Replies:** 0\
**Last updated:** [November 28, 2007, 12:28pm UTC](https://www.ruby-forum.com/t/help-with-will-paginate/121486 "2007-11-28T12:28:50Z")

</div>

Is it possible to set different controller name in will\_paginate-links? I rengen search results by Ajax, so by default will\_paginate use a ajax-controller name in links, but I need to change it to different controller…

---

## [Populating Select Box with Hash Array](https://www.ruby-forum.com/t/populating-select-box-with-hash-array/121481)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 2\
**Last updated:** [November 28, 2007, 12:14pm UTC](https://www.ruby-forum.com/t/populating-select-box-with-hash-array/121481 "2007-11-28T12:14:34Z")

</div>

Hi, stuck with another little problem, select lists / drop down boxes. Tried to avoid these because the code looks uber scary. Anyway I’ve created a Hash Array called gender: @gender = \[‘Man’ =\> ‘male’, ‘Woman’ =\> ‘fe…

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

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