# Rails

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

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

---

## [Oracle oci8 =\> OCIError: OCI Library Initialization Error](https://www.ruby-forum.com/t/oracle-oci8-ocierror-oci-library-initialization-error/165527)

<div class="topic-metadata">

**Author:** [@robredford](https://www.ruby-forum.com/u/robredford)\
**Replies:** 1\
**Last updated:** [April 24, 2009, 6:18am UTC](https://www.ruby-forum.com/t/oracle-oci8-ocierror-oci-library-initialization-error/165527 "2009-04-24T06:18:58Z")

</div>

I’m trying to get ActiveRecord working with an Oracle DB over the instant client. On a 32bit machine, I can require ‘oci8’: Linux xxx.xxx.xxx.xxx 2.6.9-78.0.17.ELsmp #1 SMP Thu Mar 5 04:52:17 EST 2009 i686 i686 i386 …

---

## [Unable to install properly / use acts\_as\_taggable\_on -- please help](https://www.ruby-forum.com/t/unable-to-install-properly-use-acts-as-taggable-on-please-help/166339)

<div class="topic-metadata">

**Author:** [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Replies:** 0\
**Last updated:** [April 24, 2009, 3:42am UTC](https://www.ruby-forum.com/t/unable-to-install-properly-use-acts-as-taggable-on-please-help/166339 "2009-04-24T03:42:42Z")

</div>

The gem (now installed as a plugin) puts into the log the default text that it was loaded successfully, but for ‘acts\_as\_tagger’ and ‘acts\_as\_taggable\_on’ – I get NoMethodError for these. Also, rake spec:plugins fail…

---

## [Where do helper for a controller go?](https://www.ruby-forum.com/t/where-do-helper-for-a-controller-go/166270)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 3\
**Last updated:** [April 24, 2009, 1:54am UTC](https://www.ruby-forum.com/t/where-do-helper-for-a-controller-go/166270 "2009-04-24T01:54:08Z")

</div>

Hey, I just wanna make sure I’m right… I need to DRY my controller that’s why I put the code of 2 different actions into one action but I’m not sure where to put it… in the controller under private? in the helper? in…

---

## [Why does number of hits per second go from 1800 to 20?](https://www.ruby-forum.com/t/why-does-number-of-hits-per-second-go-from-1800-to-20/166200)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 15\
**Last updated:** [April 24, 2009, 12:15am UTC](https://www.ruby-forum.com/t/why-does-number-of-hits-per-second-go-from-1800-to-20/166200 "2009-04-24T00:15:40Z")

</div>

i had the following code to ball-park the number of possible hits per second my macbook can support: \<% t = Time.now %\> Hello#index Find me in app/views/hello/index.rhtml \<% for i in 1..100 do %\> \<%= Time.now %\> …

---

## [Simple question](https://www.ruby-forum.com/t/simple-question/166307)

<div class="topic-metadata">

**Author:** [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Replies:** 3\
**Last updated:** [April 23, 2009, 11:47pm UTC](https://www.ruby-forum.com/t/simple-question/166307 "2009-04-23T23:47:36Z")

</div>

I apologize for the embarrassingly simplistic nature of this question, but I’m new to Ruby/Rails. From within a html.erb file, what is the syntax for assigning a value to a parameter? For example, when a specific form…

---

## [How do I pass a hash with hidden\_field or hidden\_field\_tag](https://www.ruby-forum.com/t/how-do-i-pass-a-hash-with-hidden-field-or-hidden-field-tag/166086)

<div class="topic-metadata">

**Author:** [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Replies:** 16\
**Last updated:** [April 23, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/how-do-i-pass-a-hash-with-hidden-field-or-hidden-field-tag/166086 "2009-04-23T22:45:32Z")

</div>

Here’s what I have in my view: \<% form\_tag( :action =\> :update\_cart ) do %\> \<% for item in @cart.items %\> \<%= hidden\_field(:items, item.id =\>item.quantity ) %\> \<%=h item.name %\> \<%= text\_field\_tag( :updated\_quant…

---

## [:before\_filter validate for fields not part of model](https://www.ruby-forum.com/t/before-filter-validate-for-fields-not-part-of-model/166330)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/before-filter-validate-for-fields-not-part-of-model/166330 "2009-04-23T22:45:32Z")

</div>

I have created a pre\_validate method and put it in :before\_filter in order to make sure that a custom javascript pulldown has been selected. I am using a boolean variable as a flag that turns to true when a value is …

---

## [Backup (\*~) view files are being used instead of proper view](https://www.ruby-forum.com/t/backup-view-files-are-being-used-instead-of-proper-view/166067)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 9\
**Last updated:** [April 23, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/backup-view-files-are-being-used-instead-of-proper-view/166067 "2009-04-23T22:11:21Z")

</div>

This is a weird one. I just started making a new app, and have noticed a weird problem: I do my editing in gedit in linux, which saves backup files as ‘~’, eg “index.html.erb~” for a view template. I’m running mongr…

---

## ["Helper" for 2 controllers?](https://www.ruby-forum.com/t/helper-for-2-controllers/166325)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 4\
**Last updated:** [April 23, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/helper-for-2-controllers/166325 "2009-04-23T22:08:25Z")

</div>

Is there a DRY way to have a helper method for 2 different controllers? For example: @user.create\_points\_account(10) @group.create\_points\_account(10) and the helper method would look like this: def create\_points\_acc…

---

## [Generating Word Doc](https://www.ruby-forum.com/t/generating-word-doc/166021)

<div class="topic-metadata">

**Author:** [@sijomo](https://www.ruby-forum.com/u/sijomo)\
**Replies:** 17\
**Last updated:** [April 23, 2009, 9:16pm UTC](https://www.ruby-forum.com/t/generating-word-doc/166021 "2009-04-23T21:16:07Z")

</div>

Hi all, Does anyone have any suggestions for generating a word doc from a linux rails application? We were using html and just naming it .doc, which works well until you need to embed images into the document. MHT loo…

---

## [Is it possible to alternate row colors for collection\_select](https://www.ruby-forum.com/t/is-it-possible-to-alternate-row-colors-for-collection-select/166315)

<div class="topic-metadata">

**Author:** [@gmoniey](https://www.ruby-forum.com/u/gmoniey)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 8:45pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-alternate-row-colors-for-collection-select/166315 "2009-04-23T20:45:36Z")

</div>

Hi, I have something as such: collection\_select(:obj, :types, @types, :id, :name, {}, {:multiple =\> true, :size =\> 4}) and I want the row colors to alternate. This is easy to do when manually building the options ta…

---

## [Add rake task to default](https://www.ruby-forum.com/t/add-rake-task-to-default/166314)

<div class="topic-metadata">

**Author:** [@jemminger](https://www.ruby-forum.com/u/jemminger)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 8:40pm UTC](https://www.ruby-forum.com/t/add-rake-task-to-default/166314 "2009-04-23T20:40:18Z")

</div>

When I run “rake” at the root of my rails app, I want it to include a custom rake task. How do I hook my custom rake task into the Rails default rake task so that it runs automatically?

---

## [Rails Web Site](https://www.ruby-forum.com/t/rails-web-site/166300)

<div class="topic-metadata">

**Author:** [@Gary\_Taylor](https://www.ruby-forum.com/u/Gary_Taylor)\
**Replies:** 6\
**Last updated:** [April 23, 2009, 8:39pm UTC](https://www.ruby-forum.com/t/rails-web-site/166300 "2009-04-23T20:39:43Z")

</div>

Whenever I go to the rubyonrails.org website, it has been replaced with a page which is like a search engine for all things rails. I can’t find the documentation or anything ??? I am assuming that everyone has this p…

---

## [Controllers and form\_for](https://www.ruby-forum.com/t/controllers-and-form-for/166312)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [April 23, 2009, 8:38pm UTC](https://www.ruby-forum.com/t/controllers-and-form-for/166312 "2009-04-23T20:38:31Z")

</div>

I’m a bit confused on how this works. My form is sending to a weird location. Here’s my situation: I have a model: youtube.rb I have a controller called: youtube\_editor\_controller.rb In my youtube\_editor view, i have…

---

## [Beginning ruby session problem / how do I rollback with git?](https://www.ruby-forum.com/t/beginning-ruby-session-problem-how-do-i-rollback-with-git/166294)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 5\
**Last updated:** [April 23, 2009, 8:23pm UTC](https://www.ruby-forum.com/t/beginning-ruby-session-problem-how-do-i-rollback-with-git/166294 "2009-04-23T20:23:06Z")

</div>

Hi, Rails 2.3.2 I’m following along with the examples in AWDWR (3rd), and around about p. 103, where you are working with a session table you created, I decided to free lance a bit. At some point, I tried to “clear”…

---

## [Not quite a rails question but can anyone advise?](https://www.ruby-forum.com/t/not-quite-a-rails-question-but-can-anyone-advise/165924)

<div class="topic-metadata">

**Author:** [@dr\_gavin](https://www.ruby-forum.com/u/dr_gavin)\
**Replies:** 15\
**Last updated:** [April 23, 2009, 8:02pm UTC](https://www.ruby-forum.com/t/not-quite-a-rails-question-but-can-anyone-advise/165924 "2009-04-23T20:02:43Z")

</div>

Hey guys! I’m having a little trouble trying to integrate RMagick with my rails app. In the online terminal (on my host’s server) if I write: export “LD\_LIBRARY\_PATH=/usr/local/lib:$LD\_LIBRARY\_PATH” before opening t…

---

## [Associations In rails](https://www.ruby-forum.com/t/associations-in-rails/166280)

<div class="topic-metadata">

**Author:** [@charanya](https://www.ruby-forum.com/u/charanya)\
**Replies:** 2\
**Last updated:** [April 23, 2009, 7:53pm UTC](https://www.ruby-forum.com/t/associations-in-rails/166280 "2009-04-23T19:53:30Z")

</div>

Hi, I have these Models in my app User Request Requesttargetuser Now User has the associations has\_many :requests And the Request has the association belongs\_to :user ie.A user can post a request. But the reque…

---

## [Nil.symbolize\_keys -- error with attachment\_fu](https://www.ruby-forum.com/t/nil-symbolize-keys-error-with-attachment-fu/92327)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 3\
**Last updated:** [April 23, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/nil-symbolize-keys-error-with-attachment-fu/92327 "2009-04-23T19:33:21Z")

</div>

I’ve spent at least 2 hours on this one problem. On my local machine in my controller I have this: def new @page\_title = “New User” @user = User.new @photo = Photo.new end All is good. Now, on the remote server I…

---

## [Passenger restart problems](https://www.ruby-forum.com/t/passenger-restart-problems/166308)

<div class="topic-metadata">

**Author:** [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/passenger-restart-problems/166308 "2009-04-23T19:23:00Z")

</div>

I am following the Passenger/Capistrano/Git deployment process outlined in Chapter 28 of the Third Edition of Agile Development book. Everything seems to work well except being able to restart my application. I am on …

---

## [Error: MySQL gone away - subclass of model](https://www.ruby-forum.com/t/error-mysql-gone-away-subclass-of-model/166309)

<div class="topic-metadata">

**Author:** [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 6:58pm UTC](https://www.ruby-forum.com/t/error-mysql-gone-away-subclass-of-model/166309 "2009-04-23T18:58:56Z")

</div>

I have an authorization control which requires current user name (@currentuser.can\_update?) to check permissions. The current user info is taken from the sessions and if no user is logged in , i.e., is session has a n…

---

## [Translation inside models?](https://www.ruby-forum.com/t/translation-inside-models/166283)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 2\
**Last updated:** [April 23, 2009, 6:19pm UTC](https://www.ruby-forum.com/t/translation-inside-models/166283 "2009-04-23T18:19:00Z")

</div>

Hey people, I’m having a problem translating messages inside a model, e.g. I used to have it like this: validates\_uniqueness\_of :username, :message =\> “Username in use already” which worked fine but now I wanna inter…

---

## [NoMethodError in StoreController#add\_to\_cart](https://www.ruby-forum.com/t/nomethoderror-in-storecontroller-add-to-cart/166301)

<div class="topic-metadata">

**Author:** [@vfcforums](https://www.ruby-forum.com/u/vfcforums)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 6:11pm UTC](https://www.ruby-forum.com/t/nomethoderror-in-storecontroller-add-to-cart/166301 "2009-04-23T18:11:41Z")

</div>

Working through the Agile Web D. w/ Rails book on p114. I can add single items of each to the cart but when I try to add a second item I get the following error: NoMethodError in StoreController#add\_to\_cart You have…

---

## [RailsConf discounts?](https://www.ruby-forum.com/t/railsconf-discounts/166237)

<div class="topic-metadata">

**Author:** [@Carson\_C](https://www.ruby-forum.com/u/Carson_C)\
**Replies:** 1\
**Last updated:** [April 23, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/railsconf-discounts/166237 "2009-04-23T18:08:54Z")

</div>

I hope I am not out of line by asking if there are RailsConf discount codes floating around out there… Anyone? Need all the help I can get to fight conference price inflation…

---

## [Ruby: Object's attribute out of reach](https://www.ruby-forum.com/t/ruby-objects-attribute-out-of-reach/166299)

<div class="topic-metadata">

**Author:** [@shahroon\_ali](https://www.ruby-forum.com/u/shahroon_ali)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 5:51pm UTC](https://www.ruby-forum.com/t/ruby-objects-attribute-out-of-reach/166299 "2009-04-23T17:51:18Z")

</div>

Hi everyone, I have a very interesting problem, I dont know why I am so confused about it, here my problem is !ruby/object:Opportunity attributes: created\_at: 2009-03-28 11:29:58 position\_title: Software Engineer…

---

## [Git in InstantRails - Please](https://www.ruby-forum.com/t/git-in-instantrails-please/166278)

<div class="topic-metadata">

**Author:** [@felipecsl](https://www.ruby-forum.com/u/felipecsl)\
**Replies:** 2\
**Last updated:** [April 23, 2009, 5:27pm UTC](https://www.ruby-forum.com/t/git-in-instantrails-please/166278 "2009-04-23T17:27:49Z")

</div>

I am developing on a windows machine and using Instant Rails. I installed git and it is available from the command prompt. However, I can not seem to install any plugins from a git repository. It executes the command…

---

## [Metaprogramming oddness - works in console but fails in spec](https://www.ruby-forum.com/t/metaprogramming-oddness-works-in-console-but-fails-in-spec/166295)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 4:57pm UTC](https://www.ruby-forum.com/t/metaprogramming-oddness-works-in-console-but-fails-in-spec/166295 "2009-04-23T16:57:52Z")

</div>

Hi folks Let’s say i have these methods, and i want to abstract them into a bit of metaprogramming, for dryness’ sake: def water\_score\_for(year) self.send(“ratings.water.#{year}.collect(&:score).sum”) end def possi…

---

## [Rubyonrails.org is down?](https://www.ruby-forum.com/t/rubyonrails-org-is-down/166257)

<div class="topic-metadata">

**Author:** [@kallep](https://www.ruby-forum.com/u/kallep)\
**Replies:** 15\
**Last updated:** [April 23, 2009, 4:36pm UTC](https://www.ruby-forum.com/t/rubyonrails-org-is-down/166257 "2009-04-23T16:36:05Z")

</div>

I get a “sponsored link” page then i visit http://www.rubyonrails.org . Only me?

---

## [Email photo to upload](https://www.ruby-forum.com/t/email-photo-to-upload/165809)

<div class="topic-metadata">

**Author:** [@northband](https://www.ruby-forum.com/u/northband)\
**Replies:** 2\
**Last updated:** [April 23, 2009, 3:14pm UTC](https://www.ruby-forum.com/t/email-photo-to-upload/165809 "2009-04-23T15:14:27Z")

</div>

Hi - I am curious has anyone worked on a project where you emailed a photo to your app - which then takes the attached image and attaches it to your account? For instance, I have a photo gallery that I want to send i…

---

## [How to convert Mp3 file to 128kbps before save](https://www.ruby-forum.com/t/how-to-convert-mp3-file-to-128kbps-before-save/166284)

<div class="topic-metadata">

**Author:** [@srijith](https://www.ruby-forum.com/u/srijith)\
**Replies:** 0\
**Last updated:** [April 23, 2009, 2:12pm UTC](https://www.ruby-forum.com/t/how-to-convert-mp3-file-to-128kbps-before-save/166284 "2009-04-23T14:12:07Z")

</div>

Hi I need to convert mp3 file to 128kbps before save to the database.If any one have any idea about this please reply… Thanks & Regards babu

---

## [Can you run a find on an existing hash?](https://www.ruby-forum.com/t/can-you-run-a-find-on-an-existing-hash/166249)

<div class="topic-metadata">

**Author:** [@rjsquire](https://www.ruby-forum.com/u/rjsquire)\
**Replies:** 2\
**Last updated:** [April 23, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/can-you-run-a-find-on-an-existing-hash/166249 "2009-04-23T13:26:20Z")

</div>

This is probably a basic question, but I was wondering if / how it’s possible to run a find on an existing hash. For instance: I need to pull all products in the database for a simple list: @products = Products.fin…

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

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