# Rails

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

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

---

## [Model Associations (is this OK?)](https://www.ruby-forum.com/t/model-associations-is-this-ok/147220)

<div class="topic-metadata">

**Author:** [@noddy](https://www.ruby-forum.com/u/noddy)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 2:40pm UTC](https://www.ruby-forum.com/t/model-associations-is-this-ok/147220 "2008-08-29T14:40:05Z")

</div>

Not wishing to start out on the wrong foot in the world of RoR, I would be grateful if someone could advise me if the following setup would be considered best practice or could it be improved upon. I have five models: …

---

## [Helpers in rails to get URL using AJAX](https://www.ruby-forum.com/t/helpers-in-rails-to-get-url-using-ajax/147040)

<div class="topic-metadata">

**Author:** [@Thib21](https://www.ruby-forum.com/u/Thib21)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 1:54pm UTC](https://www.ruby-forum.com/t/helpers-in-rails-to-get-url-using-ajax/147040 "2008-08-29T13:54:53Z")

</div>

Hello all, I’m trying to get (using Ajax) whatever URL the user clicks on the page. Also, I want to store the results from the URL request in a JS variable. Did somebody know helper in Rails which allow me to do that…

---

## [Dates in ActiveRecord](https://www.ruby-forum.com/t/dates-in-activerecord/147162)

<div class="topic-metadata">

**Author:** [@Abel](https://www.ruby-forum.com/u/Abel)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 1:51pm UTC](https://www.ruby-forum.com/t/dates-in-activerecord/147162 "2008-08-29T13:51:57Z")

</div>

I’m going nuts over this incidence in my code: I have this class AdsSources \< ActiveRecord::Base and one of it’s fields is a date, but when I update this field and read it again, I always get the same wrong date like …

---

## [Newbie question for installation](https://www.ruby-forum.com/t/newbie-question-for-installation/147209)

<div class="topic-metadata">

**Author:** [@dreamramon](https://www.ruby-forum.com/u/dreamramon)\
**Replies:** 4\
**Last updated:** [August 29, 2008, 1:37pm UTC](https://www.ruby-forum.com/t/newbie-question-for-installation/147209 "2008-08-29T13:37:52Z")

</div>

Hi all… just something really confused. Today I downloaded “ruby186-26.exe” according the tutorial… then have it installed without problem then I use “gem install rails --include–dependencies” to get rails then when…

---

## [Manual reloading required file](https://www.ruby-forum.com/t/manual-reloading-required-file/147214)

<div class="topic-metadata">

**Author:** [@avanetix](https://www.ruby-forum.com/u/avanetix)\
**Replies:** 0\
**Last updated:** [August 29, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/manual-reloading-required-file/147214 "2008-08-29T13:00:54Z")

</div>

Hello. I have in my project rb-files with filenames, witch are nonqualifying rails class and module naming. How can I reload (re-require) such files after rails has once them required? I need this feauture for devel…

---

## [Selenium + Engines](https://www.ruby-forum.com/t/selenium-engines/146225)

<div class="topic-metadata">

**Author:** [@subimage](https://www.ruby-forum.com/u/subimage)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/selenium-engines/146225 "2008-08-29T12:53:15Z")

</div>

Has anyone gotten Selenium working with engines? Any pointers or tips one can pass along? I’m investigating right now, but there doesn’t seem to be much info on the subject.

---

## [Has\_many :through complex form hint request](https://www.ruby-forum.com/t/has-many-through-complex-form-hint-request/147212)

<div class="topic-metadata">

**Author:** [@crossblaim](https://www.ruby-forum.com/u/crossblaim)\
**Replies:** 0\
**Last updated:** [August 29, 2008, 12:52pm UTC](https://www.ruby-forum.com/t/has-many-through-complex-form-hint-request/147212 "2008-08-29T12:52:05Z")

</div>

hi everyone, I’ve seen a lot of examples for complex forms which involves all kinds of associations (railscasts, app examples on github, etc.), only has\_many :through have been left in the dust a bit. I’m taking adva…

---

## [Filters order in Controllers](https://www.ruby-forum.com/t/filters-order-in-controllers/147106)

<div class="topic-metadata">

**Author:** [@Antonio\_Tapiador\_de](https://www.ruby-forum.com/u/Antonio_Tapiador_de)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/filters-order-in-controllers/147106 "2008-08-29T12:50:18Z")

</div>

Hi! I’m moving my CMSplugin to Rails Engines, as it’s a very nice framework for certain features. Thank you! However, I’ve a problem with filters in Controllers. In my plugin I have the following code: class PostsC…

---

## [Validate size of but for encrypted password](https://www.ruby-forum.com/t/validate-size-of-but-for-encrypted-password/147175)

<div class="topic-metadata">

**Author:** [@ReK2SS](https://www.ruby-forum.com/u/ReK2SS)\
**Replies:** 2\
**Last updated:** [August 29, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/validate-size-of-but-for-encrypted-password/147175 "2008-08-29T12:47:57Z")

</div>

Hi, I am wondering how people will validate the size of a password field… when I use validate\_size\_of it always pass because the encrypted password is almost longer than 8 characters… so how does people force users t…

---

## [Magic Comments and Actual Comment](https://www.ruby-forum.com/t/magic-comments-and-actual-comment/147210)

<div class="topic-metadata">

**Author:** [@Hunt\_J](https://www.ruby-forum.com/u/Hunt_J)\
**Replies:** 0\
**Last updated:** [August 29, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/magic-comments-and-actual-comment/147210 "2008-08-29T12:25:39Z")

</div>

I’m trying to be ready with ruby 1.9. That doesn’t work with the current version of rails, though. If I write: -- coding: utf-8 -- Controller for dealing with users class UserController \< ApplicationController do som…

---

## [Backgroundrb - workers firing twice?](https://www.ruby-forum.com/t/backgroundrb-workers-firing-twice/74309)

<div class="topic-metadata">

**Author:** [@al-evans](https://www.ruby-forum.com/u/al-evans)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 12:05pm UTC](https://www.ruby-forum.com/t/backgroundrb-workers-firing-twice/74309 "2008-08-29T12:05:38Z")

</div>

I’ve got backgroundrb handling three periodic tasks. For some reason, each of them is firing twice on each run. From my backgroundrb.log: Daily stats in production at Sat Nov 04 03:00:41 EST 2006 Daily stats in produc…

---

## [Question About Gems And DataBase's?](https://www.ruby-forum.com/t/question-about-gems-and-databases/147183)

<div class="topic-metadata">

**Author:** [@GabrielG1976](https://www.ruby-forum.com/u/GabrielG1976)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 11:13am UTC](https://www.ruby-forum.com/t/question-about-gems-and-databases/147183 "2008-08-29T11:13:30Z")

</div>

Hello IM working on a Rails app That requires the midilib gem I have installed the gem using gemsonrails and installation went great but i was wondering where in my Application do i call the Gem At in my application c…

---

## [Help with complex hash](https://www.ruby-forum.com/t/help-with-complex-hash/147186)

<div class="topic-metadata">

**Author:** [@rustam](https://www.ruby-forum.com/u/rustam)\
**Replies:** 2\
**Last updated:** [August 29, 2008, 10:43am UTC](https://www.ruby-forum.com/t/help-with-complex-hash/147186 "2008-08-29T10:43:01Z")

</div>

i want to receive some params from html.erb and the hash from the form like this {“zinfo”=\>{“483”=\>{“onetime”=\>“32”}, “484”=\>{“onetime”=\>“32”}, “485”=\>{“onetime”=\>“22”}, “486”=\>{“onetime”=\>“22”}}, “commit”=\>“æ±ºå®…

---

## [Changing an element's class via AJAX](https://www.ruby-forum.com/t/changing-an-elements-class-via-ajax/147204)

<div class="topic-metadata">

**Author:** [@Franz\_S](https://www.ruby-forum.com/u/Franz_S)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 10:42am UTC](https://www.ruby-forum.com/t/changing-an-elements-class-via-ajax/147204 "2008-08-29T10:42:26Z")

</div>

Greetings folks, Does anyone know how I can modify a DOM element’s class on the fly via AJAX? Is this even possible? I basically want to toggle a background color after the user updates a pass/fail attribute on one …

---

## [Prototype: Inject JS variable names into generated code?](https://www.ruby-forum.com/t/prototype-inject-js-variable-names-into-generated-code/147177)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 10:17am UTC](https://www.ruby-forum.com/t/prototype-inject-js-variable-names-into-generated-code/147177 "2008-08-29T10:17:47Z")

</div>

There’s probably a smarter way to do this. I have a list view, with each record (about 50 total) displaying a priority. I want to let the user click quickly on the priority to change it (to one of four other variable…

---

## [Active Mehcant + Transaction is invalid?](https://www.ruby-forum.com/t/active-mehcant-transaction-is-invalid/145029)

<div class="topic-metadata">

**Author:** [@prionko](https://www.ruby-forum.com/u/prionko)\
**Replies:** 4\
**Last updated:** [August 29, 2008, 10:06am UTC](https://www.ruby-forum.com/t/active-mehcant-transaction-is-invalid/145029 "2008-08-29T10:06:02Z")

</div>

Hi, I have followed Cody F.'s tutorial ‘PayPal Express Payments with ActiveMerchant’ \[http://www.codyfauser.com/2008/1/17/paypal-express-payments-with-activemerchant\] and its working fine for me in my local system. B…

---

## [Mongrel incorrectly reports missing PID files](https://www.ruby-forum.com/t/mongrel-incorrectly-reports-missing-pid-files/146570)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 6\
**Last updated:** [August 29, 2008, 10:05am UTC](https://www.ruby-forum.com/t/mongrel-incorrectly-reports-missing-pid-files/146570 "2008-08-29T10:05:16Z")

</div>

I’m getting some strange behavior on a Mongrel deployment (my first, please be patient). I’ve set up the mongrel\_cluster.yaml ok and I can start the cluster OK. But when I try to stop it using mongrel\_rails cluster::s…

---

## [Code caching in development period](https://www.ruby-forum.com/t/code-caching-in-development-period/147199)

<div class="topic-metadata">

**Author:** [@avanetix](https://www.ruby-forum.com/u/avanetix)\
**Replies:** 0\
**Last updated:** [August 29, 2008, 9:43am UTC](https://www.ruby-forum.com/t/code-caching-in-development-period/147199 "2008-08-29T09:43:10Z")

</div>

Hello! I make such test: I have created new RoR-project and have made one controller and on ruby library: app/controllers/test\_controller.rb lib/test.rb I have tested my simple project on 3 web-servers:: thin, mong…

---

## [RoR with cpanel](https://www.ruby-forum.com/t/ror-with-cpanel/147071)

<div class="topic-metadata">

**Author:** [@fRAnKEnSTEin](https://www.ruby-forum.com/u/fRAnKEnSTEin)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 8:24am UTC](https://www.ruby-forum.com/t/ror-with-cpanel/147071 "2008-08-29T08:24:22Z")

</div>

Hi, i am having trouble trying to set up a RoR site using cpanel. The main thing that i do not understand is that when i create the site using cpnael RoR utility it saids that after that i have to populate it with my…

---

## [Discussion forum implementation](https://www.ruby-forum.com/t/discussion-forum-implementation/147118)

<div class="topic-metadata">

**Author:** [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 8:21am UTC](https://www.ruby-forum.com/t/discussion-forum-implementation/147118 "2008-08-29T08:21:53Z")

</div>

I was wondering if anyone with experience could give some advice on choosing a discussion forum implementation. Has Beast or some other Ruby implementation worked out well for anyone? Or is it simply easier to set up …

---

## [Forcing Views](https://www.ruby-forum.com/t/forcing-views/147066)

<div class="topic-metadata">

**Author:** [@shomanishikawa](https://www.ruby-forum.com/u/shomanishikawa)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 4:29am UTC](https://www.ruby-forum.com/t/forcing-views/147066 "2008-08-29T04:29:13Z")

</div>

Hi guys, I’m using attachment\_fu to upload large files, and when the user presses submit on the form action/view and calls the “create” action, it uploads the file, and then redirects the user to an index action/view…

---

## [Auto\_complete\_for and more](https://www.ruby-forum.com/t/auto-complete-for-and-more/147179)

<div class="topic-metadata">

**Author:** [@Jorg\_L](https://www.ruby-forum.com/u/Jorg_L)\
**Replies:** 0\
**Last updated:** [August 29, 2008, 4:06am UTC](https://www.ruby-forum.com/t/auto-complete-for-and-more/147179 "2008-08-29T04:06:04Z")

</div>

Using the auto\_complete\_for method to fill a field is fine and dandy. The controller filters down the list and then you get your object. But what if you have a lot of the same elements in a field like last name? Once…

---

## [Business logic in controller?](https://www.ruby-forum.com/t/business-logic-in-controller/147150)

<div class="topic-metadata">

**Author:** [@billv](https://www.ruby-forum.com/u/billv)\
**Replies:** 4\
**Last updated:** [August 29, 2008, 3:31am UTC](https://www.ruby-forum.com/t/business-logic-in-controller/147150 "2008-08-29T03:31:32Z")

</div>

I’ve been striving to learn proper Rails practices and have an “opinionated” question. I’ve seen stated in many places that the business logic belongs primarily in the model. How important is that? I have a case in …

---

## [Help with activerecord, has\_many and :order, please](https://www.ruby-forum.com/t/help-with-activerecord-has-many-and-order-please/147151)

<div class="topic-metadata">

**Author:** [@olia](https://www.ruby-forum.com/u/olia)\
**Replies:** 3\
**Last updated:** [August 29, 2008, 2:37am UTC](https://www.ruby-forum.com/t/help-with-activerecord-has-many-and-order-please/147151 "2008-08-29T02:37:09Z")

</div>

Hi, very much a newbie, so please excuse the basic question. Here is what I have: class Author \< ActiveRecord::Base has\_many :books end class Books \< ActiveRecord::Base belongs\_to :author end What I am trying to…

---

## [Date\_select problem](https://www.ruby-forum.com/t/date-select-problem/147166)

<div class="topic-metadata">

**Author:** [@billv](https://www.ruby-forum.com/u/billv)\
**Replies:** 1\
**Last updated:** [August 29, 2008, 12:26am UTC](https://www.ruby-forum.com/t/date-select-problem/147166 "2008-08-29T00:26:09Z")

</div>

Hi, I’m entering two dates into a view through the date\_select helper, the first relates to a field in the database, the second has been added to the model with attr\_accessor. When the create action is invoked, it f…

---

## [Migration flag](https://www.ruby-forum.com/t/migration-flag/147157)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 2\
**Last updated:** [August 28, 2008, 11:22pm UTC](https://www.ruby-forum.com/t/migration-flag/147157 "2008-08-28T23:22:17Z")

</div>

Is there anything wrong with creating an application wide flag to signify when code is migrating? How can I detect if a the environment is currently in migrating mode. Does anyone have some methods for this?

---

## [Default Database with ODBC and SQL Server](https://www.ruby-forum.com/t/default-database-with-odbc-and-sql-server/147160)

<div class="topic-metadata">

**Author:** [@sjames](https://www.ruby-forum.com/u/sjames)\
**Replies:** 0\
**Last updated:** [August 28, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/default-database-with-odbc-and-sql-server/147160 "2008-08-28T22:49:29Z")

</div>

I’m trying to set up a Rails application to use an ODBC connection to a MS SQL Server 2005 system. I’m finding that if I don’t specify a default database the connection works, but if I do the connection fails. Does …

---

## [RS232 in ruby](https://www.ruby-forum.com/t/rs232-in-ruby/147107)

<div class="topic-metadata">

**Author:** [@shanmugam](https://www.ruby-forum.com/u/shanmugam)\
**Replies:** 5\
**Last updated:** [August 28, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/rs232-in-ruby/147107 "2008-08-28T22:34:49Z")

</div>

is it possible in Ruby to interface with a device through a RS232 serial connection? I want to connect my Windows XP computer with a medical device through RS232 - get data from the device and send it messages.

---

## [Bluehost deployment](https://www.ruby-forum.com/t/bluehost-deployment/146664)

<div class="topic-metadata">

**Author:** [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Replies:** 2\
**Last updated:** [August 28, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/bluehost-deployment/146664 "2008-08-28T22:15:26Z")

</div>

Hello friend, I need to deploy my application on bluehost server. But everwhere i am getting an example of hosting using subdomain. for for access site i need to do something http://subdomain.mysitename.com instead o…

---

## [1 or true in TINYINT(1) column?](https://www.ruby-forum.com/t/1-or-true-in-tinyint-1-column/147137)

<div class="topic-metadata">

**Author:** [@j.francisco](https://www.ruby-forum.com/u/j.francisco)\
**Replies:** 2\
**Last updated:** [August 28, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/1-or-true-in-tinyint-1-column/147137 "2008-08-28T21:03:18Z")

</div>

Hello, there is a table that has a column TINYINT(1) called status. Through mysql console I see its value as 1 (when is true) but if I do this in Rails console: Mytable.status =\> true give me “true” rather “1”. How…

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

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