# Rails

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

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

---

## [How to add a method to an existing class and use it in rails environment](https://www.ruby-forum.com/t/how-to-add-a-method-to-an-existing-class-and-use-it-in-rails-environment/142121)

<div class="topic-metadata">

**Author:** [@pbn](https://www.ruby-forum.com/u/pbn)\
**Replies:** 4\
**Last updated:** [July 3, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/how-to-add-a-method-to-an-existing-class-and-use-it-in-rails-environment/142121 "2008-07-03T21:57:33Z")

</div>

Hi, I am using rails 2.0.2 version and I have a need to add a method to an existing class and use it in the rails environment. For example, I would like to add a method to Numeric class, so I coded it as follows clas…

---

## [How would u do this?](https://www.ruby-forum.com/t/how-would-u-do-this/142040)

<div class="topic-metadata">

**Author:** [@nahabed](https://www.ruby-forum.com/u/nahabed)\
**Replies:** 8\
**Last updated:** [July 3, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/how-would-u-do-this/142040 "2008-07-03T21:18:53Z")

</div>

Pardon the newbism :slight\_smile: I’ve inhereted this bit of code and it is being used in a couple of rhtml files. I’d like to avoid duplicate code by pulling this out somehow - how would you do this? This is an ecomme…

---

## [REST and remote\_form\_for](https://www.ruby-forum.com/t/rest-and-remote-form-for/141942)

<div class="topic-metadata">

**Author:** [@itkin](https://www.ruby-forum.com/u/itkin)\
**Replies:** 3\
**Last updated:** [July 3, 2008, 8:54pm UTC](https://www.ruby-forum.com/t/rest-and-remote-form-for/141942 "2008-07-03T20:54:12Z")

</div>

Hi, I don’t see where i’m wrong, it’s probably terribly stupid, but i don’t get the point… I’m investigating the resources mapping, but the path mapping doesn’t seem to work : in my config directory map.resources :…

---

## [Opposite of Cache Sweeper?](https://www.ruby-forum.com/t/opposite-of-cache-sweeper/142071)

<div class="topic-metadata">

**Author:** [@iplat](https://www.ruby-forum.com/u/iplat)\
**Replies:** 3\
**Last updated:** [July 3, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/opposite-of-cache-sweeper/142071 "2008-07-03T20:27:50Z")

</div>

I’m looking for an acceptable way to cache images when they are inserted into the database. Essentially an observer for the model, however, i feel that this is not a concern of the model. Currently i’m using the cache…

---

## [Error when installing JRuby](https://www.ruby-forum.com/t/error-when-installing-jruby/142137)

<div class="topic-metadata">

**Author:** [@phseth2001](https://www.ruby-forum.com/u/phseth2001)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/error-when-installing-jruby/142137 "2008-07-03T20:27:08Z")

</div>

Whenever I try to install JRuby, I get the following error. This is on AIX 5.3-5. root@nycserv-deva-app1nim:/usr/local/bin/ruby\_inst/jruby-1.1.2\>bin/jruby rubyfile.rb The java class is not found: org.jruby.Main The…

---

## [Build versus new](https://www.ruby-forum.com/t/build-versus-new/142138)

<div class="topic-metadata">

**Author:** [@AnnaLissa\_C](https://www.ruby-forum.com/u/AnnaLissa_C)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/build-versus-new/142138 "2008-07-03T19:42:38Z")

</div>

I like the simplicity and elegance of creating a new associated object with: @todo = @current\_user.todos.build(params\[:todo\]) versus @todo = Todo.new(params\[:todo\]) @todo.user = @current\_user But isn’t the first so…

---

## [Validates\_uniqueness\_of fails because (1) no index on subject, (2) sqlite3 problem or (3) other?](https://www.ruby-forum.com/t/validates-uniqueness-of-fails-because-1-no-index-on-subject-2-sqlite3-problem-or-3-other/141228)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 9\
**Last updated:** [July 3, 2008, 7:40pm UTC](https://www.ruby-forum.com/t/validates-uniqueness-of-fails-because-1-no-index-on-subject-2-sqlite3-problem-or-3-other/141228 "2008-07-03T19:40:18Z")

</div>

Hi, I’ve got 5 validations on my model. Only one of them fails to perform as expected: class Portfolio \< ActiveRecord::Base \[snip\] validates\_uniqueness\_of :symbol end I’m running Rails 2.0.2. I created the app f…

---

## [Second question on using RSpec for a simple Rails 2.0 app](https://www.ruby-forum.com/t/second-question-on-using-rspec-for-a-simple-rails-2-0-app/141713)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 5\
**Last updated:** [July 3, 2008, 7:40pm UTC](https://www.ruby-forum.com/t/second-question-on-using-rspec-for-a-simple-rails-2-0-app/141713 "2008-07-03T19:40:17Z")

</div>

Hi, I’ve got a Rails 2.0 app “AIMS\_1” with one model, “Portfolio”. (I’m following David C.’s 2007 tutorial at http://blog.davidchelimsky.net/articles/2007/05/14/an-introduction-to-rspec-part-i). Portfolio has two …

---

## [Render :text in Rails 2.1](https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125)

<div class="topic-metadata">

**Author:** [@pedz](https://www.ruby-forum.com/u/pedz)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 7:10pm UTC](https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125 "2008-07-03T19:10:45Z")

</div>

I’m trying to get my “in place editor” controls working again after moving up to Rails 2.1. I got the authenticity token working and everything is fine except the render. Maybe I never did it right in the first plac…

---

## [Filters](https://www.ruby-forum.com/t/filters/142088)

<div class="topic-metadata">

**Author:** [@jschank](https://www.ruby-forum.com/u/jschank)\
**Replies:** 3\
**Last updated:** [July 3, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/filters/142088 "2008-07-03T19:00:57Z")

</div>

Hello, I’m new to rails and ruby. I’m reading Simply Rails 2, and working through the chapters to learn how to use rails. – backstory – We’re on chapter 8 or so where we are learning about filters. At this step we a…

---

## [What happens when a mongrel\_cluster starts?](https://www.ruby-forum.com/t/what-happens-when-a-mongrel-cluster-starts/142128)

<div class="topic-metadata">

**Author:** [@Obelix](https://www.ruby-forum.com/u/Obelix)\
**Replies:** 0\
**Last updated:** [July 3, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/what-happens-when-a-mongrel-cluster-starts/142128 "2008-07-03T18:47:28Z")

</div>

My server is running in a node in www.linodes.com, so it is not a fast server. I have a mongrel cluster with 3 instances. When I do a mongrel\_cluster start, the 3 mongrel\_rails instances churn at 15-20% CPU for abou…

---

## [Include xsl template in .rxml file](https://www.ruby-forum.com/t/include-xsl-template-in-rxml-file/142103)

<div class="topic-metadata">

**Author:** [@Iain\_A](https://www.ruby-forum.com/u/Iain_A)\
**Replies:** 1\
**Last updated:** [July 3, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/include-xsl-template-in-rxml-file/142103 "2008-07-03T18:45:42Z")

</div>

Hello, I have the following code: xml.instruct! :xml, :version=\>“1.0” xml.instruct! ‘xml-stylesheet’, :href=\>’/stylesheets/java\_app.xsl’ xml.blueman do xml.response do xml.code(@response.code) @response.url ||= “” …

---

## [Problem with include\_blank](https://www.ruby-forum.com/t/problem-with-include-blank/142124)

<div class="topic-metadata">

**Author:** [@eddy\_b](https://www.ruby-forum.com/u/eddy_b)\
**Replies:** 0\
**Last updated:** [July 3, 2008, 5:58pm UTC](https://www.ruby-forum.com/t/problem-with-include-blank/142124 "2008-07-03T17:58:31Z")

</div>

Hi, I’ve got a ‘easy’ question. I have a formular with a datetime field and I want blank field with a white space - char because the normal way with :include\_blank is not w3c - conform. Has anyboy an idea? I use this…

---

## [Mapping active record objects to virtual attributes](https://www.ruby-forum.com/t/mapping-active-record-objects-to-virtual-attributes/127739)

<div class="topic-metadata">

**Author:** [@acampos](https://www.ruby-forum.com/u/acampos)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 5:33pm UTC](https://www.ruby-forum.com/t/mapping-active-record-objects-to-virtual-attributes/127739 "2008-07-03T17:33:49Z")

</div>

I’ve got a phone number field defined in a model as a single String. However, the form used to input the phone number exposes the number as three distinct fields to help the user enter the number in the correct format…

---

## [Occurred url\_for ERROR mesasge while using will\_paginate](https://www.ruby-forum.com/t/occurred-url-for-error-mesasge-while-using-will-paginate/135018)

<div class="topic-metadata">

**Author:** [@FireStoke](https://www.ruby-forum.com/u/FireStoke)\
**Replies:** 12\
**Last updated:** [July 3, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/occurred-url-for-error-mesasge-while-using-will-paginate/135018 "2008-07-03T16:53:32Z")

</div>

Hi, I am trying pagination with using the plug-in: will\_paginate. Here is my code, I got a scaffold model named “post”. in posts\_controller.rb: I insert the following code in the index method def index … @posts = P…

---

## [Install/enable openssl for rails 2.0.2](https://www.ruby-forum.com/t/install-enable-openssl-for-rails-2-0-2/142065)

<div class="topic-metadata">

**Author:** [@jasonb](https://www.ruby-forum.com/u/jasonb)\
**Replies:** 4\
**Last updated:** [July 3, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/install-enable-openssl-for-rails-2-0-2/142065 "2008-07-03T16:47:21Z")

</div>

I was trying to install Redmine on rails 2.0.2 and I received the following error message: no such file to load – openssl I went to /ruby-1.8.6/ext/openssl and typed make and received the following error message: ma…

---

## [Restful Paradigm: How do I know when to create a new controller?](https://www.ruby-forum.com/t/restful-paradigm-how-do-i-know-when-to-create-a-new-controller/142080)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [July 3, 2008, 4:38pm UTC](https://www.ruby-forum.com/t/restful-paradigm-how-do-i-know-when-to-create-a-new-controller/142080 "2008-07-03T16:38:02Z")

</div>

I’ve read a lot of articles and tutorials about how to use Rest, but one thing I haven’t seen in many of them is when to create controllers. In many cases I have controllers with only 1 method in them (usually a creat…

---

## [Video uploading error with Safari Browser](https://www.ruby-forum.com/t/video-uploading-error-with-safari-browser/142117)

<div class="topic-metadata">

**Author:** [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Replies:** 0\
**Last updated:** [July 3, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/video-uploading-error-with-safari-browser/142117 "2008-07-03T16:19:30Z")

</div>

Hi all, In “New Video” page user enter the new video details and click “Upload” button the system is displaying error page with Safari Browser on Windows machine. Code : - fold - unfold NoMethodError in Resources…

---

## [Save Button Problem in IE7](https://www.ruby-forum.com/t/save-button-problem-in-ie7/142115)

<div class="topic-metadata">

**Author:** [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Replies:** 0\
**Last updated:** [July 3, 2008, 4:16pm UTC](https://www.ruby-forum.com/t/save-button-problem-in-ie7/142115 "2008-07-03T16:16:26Z")

</div>

Hi, I am unable to submit a form in IE7 using form\_remote\_tag , this works pretty good in FF and Safari too. View : \<%= form\_remote\_tag(:url =\> {:controller =\> :account, :action =\> :update\_profile}, :be…

---

## [Select\_tag](https://www.ruby-forum.com/t/select-tag/142093)

<div class="topic-metadata">

**Author:** [@torso](https://www.ruby-forum.com/u/torso)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/select-tag/142093 "2008-07-03T16:08:43Z")

</div>

Hi I have this kind of problem. I have table called item and there is column called priority. So i have to do select tag for priority. Priority: \<% @item.priority = 3 %\> \<%= select\_tag "item","priority",\[1,2,3,4,5\] %\>…

---

## [How to change column names](https://www.ruby-forum.com/t/how-to-change-column-names/142082)

<div class="topic-metadata">

**Author:** [@hemisphere](https://www.ruby-forum.com/u/hemisphere)\
**Replies:** 1\
**Last updated:** [July 3, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-change-column-names/142082 "2008-07-03T15:36:27Z")

</div>

I want to change my column’s names of my table only in view mode. I don’t want to change database. For example in my table there is a column “code\_id” but in rhtml file when i write column.name it shoul gives me “Id…

---

## [Image resize](https://www.ruby-forum.com/t/image-resize/142086)

<div class="topic-metadata">

**Author:** [@mamoona](https://www.ruby-forum.com/u/mamoona)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 3:33pm UTC](https://www.ruby-forum.com/t/image-resize/142086 "2008-07-03T15:33:31Z")

</div>

I have uploaded image form a form and save it in public/images directory and had saved its information in a table. Now i want whenever i click the image its enlarged view can be seen. What should i do? Should i create…

---

## [Initial objects configuration at environment.rb](https://www.ruby-forum.com/t/initial-objects-configuration-at-environment-rb/142106)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 3:32pm UTC](https://www.ruby-forum.com/t/initial-objects-configuration-at-environment-rb/142106 "2008-07-03T15:32:25Z")

</div>

Hi all, I want Rails to execute some code when starting the server, just at the beginning. I can add code to environment.rb; however, if this code makes reference to the classes in app/models/, an exception appears, …

---

## [How to not pluralize in rails 2.1?](https://www.ruby-forum.com/t/how-to-not-pluralize-in-rails-2-1/142104)

<div class="topic-metadata">

**Author:** [@adrianod](https://www.ruby-forum.com/u/adrianod)\
**Replies:** 3\
**Last updated:** [July 3, 2008, 3:31pm UTC](https://www.ruby-forum.com/t/how-to-not-pluralize-in-rails-2-1/142104 "2008-07-03T15:31:38Z")

</div>

For some reason I need to generate scaffolds but I donÂ´t want the name to be pluralized, is there any way to do it ?

---

## [Client-Side Validation plugin by Michael Schuerig](https://www.ruby-forum.com/t/client-side-validation-plugin-by-michael-schuerig/142077)

<div class="topic-metadata">

**Author:** [@sadeesh\_kumar](https://www.ruby-forum.com/u/sadeesh_kumar)\
**Replies:** 1\
**Last updated:** [July 3, 2008, 3:21pm UTC](https://www.ruby-forum.com/t/client-side-validation-plugin-by-michael-schuerig/142077 "2008-07-03T15:21:46Z")

</div>

Hi, I tried Client-Side Validation plugin (also added required Validation Reflection plugin). But no validation is happening for me. Any detailed docs is available for this plugin to follow. Or any other way to make …

---

## [Rendering action into div](https://www.ruby-forum.com/t/rendering-action-into-div/142055)

<div class="topic-metadata">

**Author:** [@skaverat](https://www.ruby-forum.com/u/skaverat)\
**Replies:** 10\
**Last updated:** [July 3, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/rendering-action-into-div/142055 "2008-07-03T14:29:50Z")

</div>

Is there a way to render an action into a div? i.e.: I click on a link\_to\_remote link, and the content of an action is put into an

---

## [Question on Ranges](https://www.ruby-forum.com/t/question-on-ranges/141990)

<div class="topic-metadata">

**Author:** [@Mukund](https://www.ruby-forum.com/u/Mukund)\
**Replies:** 4\
**Last updated:** [July 3, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/question-on-ranges/141990 "2008-07-03T14:19:39Z")

</div>

Why am I not able to do this? x=Time.now y=Time.now + 1.year (x…y).step(1.week) The step function just goes seems to hang in a loop. Shouldn’t it return the remaining weeks in the current year (ignoring the start …

---

## [Multiple database connection](https://www.ruby-forum.com/t/multiple-database-connection/142094)

<div class="topic-metadata">

**Author:** [@jaiganez](https://www.ruby-forum.com/u/jaiganez)\
**Replies:** 5\
**Last updated:** [July 3, 2008, 1:44pm UTC](https://www.ruby-forum.com/t/multiple-database-connection/142094 "2008-07-03T13:44:53Z")

</div>

hai…friends… how to create multiple mysql database ??pls help i ve used the following type but it creates only one database mobile\_development…any help pls… development: adapter: mysql database: mobile\_development …

---

## ["Marshal Data Too Short" error reading Session Data](https://www.ruby-forum.com/t/marshal-data-too-short-error-reading-session-data/142066)

<div class="topic-metadata">

**Author:** [@Diego](https://www.ruby-forum.com/u/Diego)\
**Replies:** 2\
**Last updated:** [July 3, 2008, 12:43pm UTC](https://www.ruby-forum.com/t/marshal-data-too-short-error-reading-session-data/142066 "2008-07-03T12:43:00Z")

</div>

Hi all, I am experiencing an error when reading session data. The problem is that it doesn’t happen all the time, in most cases it doesn’t occur. But it does so enough to start to become annoying. It happens when try…

---

## [Issues with App upgrade from rails 1.2.3 to rails 2.1.0](https://www.ruby-forum.com/t/issues-with-app-upgrade-from-rails-1-2-3-to-rails-2-1-0/142079)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 1\
**Last updated:** [July 3, 2008, 12:05pm UTC](https://www.ruby-forum.com/t/issues-with-app-upgrade-from-rails-1-2-3-to-rails-2-1-0/142079 "2008-07-03T12:05:35Z")

</div>

Hi, I am upgrading my rails app from 1.2.3 to 2.1, but facing many issues: Few things that i noticed are : Exception\_notifier plugin fails : ActionView::TemplateFinder::InvalidViewPath (Unprocessed view path found…

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

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