# Rails

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

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

---

## [Trim all input fields](https://www.ruby-forum.com/t/trim-all-input-fields/164006)

<div class="topic-metadata">

**Author:** [@nikhilvaghela](https://www.ruby-forum.com/u/nikhilvaghela)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 10:27pm UTC](https://www.ruby-forum.com/t/trim-all-input-fields/164006 "2009-03-26T22:27:25Z")

</div>

Hi all, What is the easiest way to trim all input fields before validation. Also on error the field should show the trimed version of the data. Any help would be appreciated, Thanks.

---

## [How to stop SOAP4R/OpenSSL requiring cert?](https://www.ruby-forum.com/t/how-to-stop-soap4r-openssl-requiring-cert/155329)

<div class="topic-metadata">

**Author:** [@mike343](https://www.ruby-forum.com/u/mike343)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 10:15pm UTC](https://www.ruby-forum.com/t/how-to-stop-soap4r-openssl-requiring-cert/155329 "2009-03-26T22:15:04Z")

</div>

Hi I want to consume some web services that are only available over HTTPS. My method looks like this: def lookup\_id myid=params\[:id\] driver = SOAP::WSDLDriverFactory.new(“https://server.com/xxx.wsdl”).create\_rpc\_dr…

---

## [Naming Conventions for Associations](https://www.ruby-forum.com/t/naming-conventions-for-associations/163963)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 3\
**Last updated:** [March 26, 2009, 9:18pm UTC](https://www.ruby-forum.com/t/naming-conventions-for-associations/163963 "2009-03-26T21:18:09Z")

</div>

Hi Everyone, I seem to continually have this internal debate on how I should approach naming certain associations on models. For example, let’s say I have a User model and a User has one Status. Although, let’s als…

---

## [What is taking so long to display this page?](https://www.ruby-forum.com/t/what-is-taking-so-long-to-display-this-page/163984)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 8:55pm UTC](https://www.ruby-forum.com/t/what-is-taking-so-long-to-display-this-page/163984 "2009-03-26T20:55:09Z")

</div>

I have a page that does a lot of calculations…that for some reason takes 19 seconds to load when running in my development environment. Looking at my logs I can see Rendering took .8 seconds and the DB took 2.38 secon…

---

## [Turning off the layout in ActionMailer?](https://www.ruby-forum.com/t/turning-off-the-layout-in-actionmailer/163920)

<div class="topic-metadata">

**Author:** [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/turning-off-the-layout-in-actionmailer/163920 "2009-03-26T20:27:32Z")

</div>

So I’m happy to see that ActionMailer supports layouts now (it may have for a while, but I just now realized it). But I don’t see a way to turn them off selectively or by multipart type. For example, if I have a layo…

---

## [ActionMailer Layout on HTML version not Plain Text](https://www.ruby-forum.com/t/actionmailer-layout-on-html-version-not-plain-text/162132)

<div class="topic-metadata">

**Author:** [@nappin](https://www.ruby-forum.com/u/nappin)\
**Replies:** 5\
**Last updated:** [March 26, 2009, 8:21pm UTC](https://www.ruby-forum.com/t/actionmailer-layout-on-html-version-not-plain-text/162132 "2009-03-26T20:21:37Z")

</div>

I’m sending plain text and html emails by having multiple files for each email I send. For example, for my registration email I have a registration.text.plain.erb file and a registration.text.html.erb file. I want to…

---

## [How to add .patch](https://www.ruby-forum.com/t/how-to-add-patch/163914)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 8:06pm UTC](https://www.ruby-forum.com/t/how-to-add-patch/163914 "2009-03-26T20:06:57Z")

</div>

Noob question here: How do I add this patch to activemerchant? http://jadedpixel.lighthouseapp.com/attachments/24184/paymentech\_gateway.patch

---

## [Help with a validation issue..? Tying 2 validations together](https://www.ruby-forum.com/t/help-with-a-validation-issue-tying-2-validations-together/164001)

<div class="topic-metadata">

**Author:** [@dhmspector](https://www.ruby-forum.com/u/dhmspector)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/help-with-a-validation-issue-tying-2-validations-together/164001 "2009-03-26T19:52:14Z")

</div>

Hi, I am trying to validate a field upon the presence of a value of another field – the two are linked for example my records have fields like this: t.decimal "admin\_headcount", :precision =\> 10…

---

## [Help with code](https://www.ruby-forum.com/t/help-with-code/163988)

<div class="topic-metadata">

**Author:** [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Replies:** 3\
**Last updated:** [March 26, 2009, 7:07pm UTC](https://www.ruby-forum.com/t/help-with-code/163988 "2009-03-26T19:07:52Z")

</div>

Hi everybody, first at ll sorry if my english is not the best. I’m trying to implement this javascript in my aplication: ItÂ´s a simple start rating implemented with javascript. ThereÂ´s no problem because I put it …

---

## [Helper caching issue](https://www.ruby-forum.com/t/helper-caching-issue/163995)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/helper-caching-issue/163995 "2009-03-26T18:37:36Z")

</div>

I have a helper: def pretty\_datetime( dt ) dt.strftime( “%b %d, %Y %I:%m%p” ) end and I have a partial that uses the helper like this: \<%= pretty\_datetime alert.updated\_at %\> The problem is when I update the record…

---

## [Using Rails Scaffold command does not preserve Case on Table Name](https://www.ruby-forum.com/t/using-rails-scaffold-command-does-not-preserve-case-on-table-name/163986)

<div class="topic-metadata">

**Author:** [@eengnerd](https://www.ruby-forum.com/u/eengnerd)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/using-rails-scaffold-command-does-not-preserve-case-on-table-name/163986 "2009-03-26T18:37:01Z")

</div>

The following command issued at the terminal prompt for a Rails project should create a PostGreSQL table with the actual Table Name of Customers, but instead it creates a Table Name of customers. This is extremely di…

---

## [Ordering of messages in error\_messages\_for](https://www.ruby-forum.com/t/ordering-of-messages-in-error-messages-for/162398)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 6:36pm UTC](https://www.ruby-forum.com/t/ordering-of-messages-in-error-messages-for/162398 "2009-03-26T18:36:24Z")

</div>

Is there any way to control the ordering of the error messages in the output of error\_messages\_for()? I want to make the error messages match the order of the form elements in my form, and although the validates\_prese…

---

## [How to prevent user assign value to attribute in ActiveRecord](https://www.ruby-forum.com/t/how-to-prevent-user-assign-value-to-attribute-in-activerecord/163992)

<div class="topic-metadata">

**Author:** [@noelnoelu](https://www.ruby-forum.com/u/noelnoelu)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 6:25pm UTC](https://www.ruby-forum.com/t/how-to-prevent-user-assign-value-to-attribute-in-activerecord/163992 "2009-03-26T18:25:50Z")

</div>

I have class bill like below class Bill \< ActiveRecord::Base #total = field in database has\_many :items after\_save :calculate\_total def calculate\_total total = self.items.map{|item| item.price}.sum end end From …

---

## [Using same variable in controller](https://www.ruby-forum.com/t/using-same-variable-in-controller/163915)

<div class="topic-metadata">

**Author:** [@arghx1](https://www.ruby-forum.com/u/arghx1)\
**Replies:** 3\
**Last updated:** [March 26, 2009, 6:13pm UTC](https://www.ruby-forum.com/t/using-same-variable-in-controller/163915 "2009-03-26T18:13:52Z")

</div>

Hi guys! More question :P~ OK, I’m following a tutorial for rail, and I got this new.html.erb in views, and in order for a form to be showed up correctly without error, I had to add this small snippet of code in the …

---

## [I have nill object when i didn't expect it](https://www.ruby-forum.com/t/i-have-nill-object-when-i-didnt-expect-it/163853)

<div class="topic-metadata">

**Author:** [@eswarrior](https://www.ruby-forum.com/u/eswarrior)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/i-have-nill-object-when-i-didnt-expect-it/163853 "2009-03-26T18:03:00Z")

</div>

You have a nil object when you didn’t expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.\[\]= I made a simple pages admin. When i tried to automate the permali…

---

## [Need suggestion Ruby To Gtk](https://www.ruby-forum.com/t/need-suggestion-ruby-to-gtk/163987)

<div class="topic-metadata">

**Author:** [@Arulalan\_T](https://www.ruby-forum.com/u/Arulalan_T)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 5:57pm UTC](https://www.ruby-forum.com/t/need-suggestion-ruby-to-gtk/163987 "2009-03-26T17:57:34Z")

</div>

Hi to all, I am very much interested in ruby and also likes to participate in gsoc 2009. In ruby having TK to develop GUI. But even though mostly all people using GTK+ to develop GUI in ubuntu and few more distribu…

---

## [Ruby script/server error](https://www.ruby-forum.com/t/ruby-script-server-error/163985)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 5:52pm UTC](https://www.ruby-forum.com/t/ruby-script-server-error/163985 "2009-03-26T17:52:16Z")

</div>

I updated the ruby gems and now I keep getting this error when trying to run: ruby script/server dyld: NSLinkModule() error dyld: Symbol not found: \_rb\_thread\_alive\_p Referenced from: /Users/mikejahn/.gem/ruby/1.8/ge…

---

## [Restful\_authentication - how does encryption work?](https://www.ruby-forum.com/t/restful-authentication-how-does-encryption-work/163933)

<div class="topic-metadata">

**Author:** [@schone](https://www.ruby-forum.com/u/schone)\
**Replies:** 4\
**Last updated:** [March 26, 2009, 5:51pm UTC](https://www.ruby-forum.com/t/restful-authentication-how-does-encryption-work/163933 "2009-03-26T17:51:41Z")

</div>

Hi all, I’m trying to understand how the restful\_authentication encryption of the password works. I understand that there is three key fields in teh database (schema migration file): login encrypted\_password salt I…

---

## [Version fu problem](https://www.ruby-forum.com/t/version-fu-problem/163916)

<div class="topic-metadata">

**Author:** [@Freddy\_A](https://www.ruby-forum.com/u/Freddy_A)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/version-fu-problem/163916 "2009-03-26T17:16:30Z")

</div>

Hi, I have a class that uses version\_fu (Page class) the issue is that if I run a clean migration it fails on the version\_fu declaration in the Page class, Its looking for the page\_versions column that has not been c…

---

## [Rails 2.3.2 nested forms, option\_groups etc](https://www.ruby-forum.com/t/rails-2-3-2-nested-forms-option-groups-etc/163980)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 5:10pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-nested-forms-option-groups-etc/163980 "2009-03-26T17:10:18Z")

</div>

Working in 2.3.2 and working from the examples in Github for nested forms, this works fine for simple text fields, or simple selects but option\_groups\_from\_collection\_for\_select is a bit more complicated. The js code …

---

## [About show list](https://www.ruby-forum.com/t/about-show-list/163937)

<div class="topic-metadata">

**Author:** [@ple\_mazako](https://www.ruby-forum.com/u/ple_mazako)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 4:59pm UTC](https://www.ruby-forum.com/t/about-show-list/163937 "2009-03-26T16:59:49Z")

</div>

hello, i want to create database for individual user . when user login and add sequences in to database .the web page show list of sequences that user have in database. but when i try show the list of of sequences …

---

## [Another problem starting mongrel](https://www.ruby-forum.com/t/another-problem-starting-mongrel/163976)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 4:48pm UTC](https://www.ruby-forum.com/t/another-problem-starting-mongrel/163976 "2009-03-26T16:48:32Z")

</div>

i am having yet another problem starting mongrel on my production server… i am getting error \[1\] … i thought it was that i needed to install a new gem, but nothing is ringing any bells… any ideas? thanks! \[1\] /us…

---

## [Suming total spend](https://www.ruby-forum.com/t/suming-total-spend/163966)

<div class="topic-metadata">

**Author:** [@Ruby\_on\_RailsS\_Talk](https://www.ruby-forum.com/u/Ruby_on_RailsS_Talk)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/suming-total-spend/163966 "2009-03-26T16:44:33Z")

</div>

Hi I have an application with a number of models. The one’s I’m interested in are customers, who have appointments. Each appointment has a number of treatments associated. I’m trying to calculate the total amount spe…

---

## [Blog installation on stage machine](https://www.ruby-forum.com/t/blog-installation-on-stage-machine/163975)

<div class="topic-metadata">

**Author:** [@palani](https://www.ruby-forum.com/u/palani)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/blog-installation-on-stage-machine/163975 "2009-03-26T16:44:07Z")

</div>

Hi, Can anyone please solve the problem . I successfully installed the wordpress blong into my Rails apps locally. my local machine is Ubuntu. Now i just want push this updation into my staging machine(which is a sli…

---

## [Data from DB based on role](https://www.ruby-forum.com/t/data-from-db-based-on-role/163961)

<div class="topic-metadata">

**Author:** [@serpico](https://www.ruby-forum.com/u/serpico)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 3:35pm UTC](https://www.ruby-forum.com/t/data-from-db-based-on-role/163961 "2009-03-26T15:35:20Z")

</div>

I’m creating a rails app requiring an ACL system to grant different priviledges to users, but I have some doubts on how to structure it. Right now I have three users: Administrator \> Area manager \> Employee I’m able t…

---

## [Gem remote Fetch error](https://www.ruby-forum.com/t/gem-remote-fetch-error/163968)

<div class="topic-metadata">

**Author:** [@sts](https://www.ruby-forum.com/u/sts)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 3:30pm UTC](https://www.ruby-forum.com/t/gem-remote-fetch-error/163968 "2009-03-26T15:30:16Z")

</div>

I keep getting this error while trying to run gem update: D:\\blog\>gem update --system Updating RubyGems… ERROR: While executing gem … (Gem::RemoteFetcher::FetchError) Bad file descriptor - connect(2)(Errno::EBADF) c…

---

## [Strange error in development mode in 2.3.2 when streaming data](https://www.ruby-forum.com/t/strange-error-in-development-mode-in-2-3-2-when-streaming-data/163967)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 0\
**Last updated:** [March 26, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/strange-error-in-development-mode-in-2-3-2-when-streaming-data/163967 "2009-03-26T15:23:33Z")

</div>

I’ve recently upgraded to 2.3.2 from 2.2.2. We used to have code in our controller that streamed data back to the browser in chunks, and that no longer works in 2.3.2. It seems to be messing up the dependency-loadin…

---

## [Trouble starting mongrel](https://www.ruby-forum.com/t/trouble-starting-mongrel/163857)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 3:01pm UTC](https://www.ruby-forum.com/t/trouble-starting-mongrel/163857 "2009-03-26T15:01:16Z")

</div>

i am having a weird problem starting mongrel on a current live server… when i start it as script/console, i get\[1\]… when i start it from the command line, i am getting\[2\]… it runs fine on my development system… i am …

---

## [Deleting files after they are sent via send\_file](https://www.ruby-forum.com/t/deleting-files-after-they-are-sent-via-send-file/163918)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 2\
**Last updated:** [March 26, 2009, 3:01pm UTC](https://www.ruby-forum.com/t/deleting-files-after-they-are-sent-via-send-file/163918 "2009-03-26T15:01:13Z")

</div>

Hello guys, I am having the option to download certain folders on my app in zip format. So every time a user requests one I’m doing a system call to zip the folder (ex: system('cd ‘+path+’ && zip …) and then the send…

---

## [Implementation of internationalization](https://www.ruby-forum.com/t/implementation-of-internationalization/163939)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [March 26, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/implementation-of-internationalization/163939 "2009-03-26T14:47:36Z")

</div>

Hello there, I am trying to implement a small application to know about internationalization. I would like to change links, button names etc to different languages which are of user interest. Can anybody tell me ho…

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

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