# Rails

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

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

---

## [\[OFF TOPIC\] - Help with Regular Expressions on PHP](https://www.ruby-forum.com/t/off-topic-help-with-regular-expressions-on-php/181621)

<div class="topic-metadata">

**Author:** [@Edson\_L](https://www.ruby-forum.com/u/Edson_L)\
**Replies:** 11\
**Last updated:** [January 15, 2010, 3:18pm UTC](https://www.ruby-forum.com/t/off-topic-help-with-regular-expressions-on-php/181621 "2010-01-15T15:18:10Z")

</div>

Hello, im having a trouble on Regular Expressions (on PHP) \* My code:\* TV LCD 32â€ H-Buster HBTV-3203HD I want to take: \*TV LCD 32â€ H-Buster HBTV-3203HD\* Is my RE going to be like that?: preg\_ma…

---

## [Help me to Install Ruby on Rail & Cucumber](https://www.ruby-forum.com/t/help-me-to-install-ruby-on-rail-cucumber/181590)

<div class="topic-metadata">

**Author:** [@sanand83](https://www.ruby-forum.com/u/sanand83)\
**Replies:** 2\
**Last updated:** [January 15, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/help-me-to-install-ruby-on-rail-cucumber/181590 "2010-01-15T15:10:58Z")

</div>

Hello, I went to Install Cucumber on my system. Can you please guide me which version of ruby on rail will support Cucumber v2.3.5? Thanks Anand S.

---

## [Is there a simply way to check if two models are associated?](https://www.ruby-forum.com/t/is-there-a-simply-way-to-check-if-two-models-are-associated/181655)

<div class="topic-metadata">

**Author:** [@85niner](https://www.ruby-forum.com/u/85niner)\
**Replies:** 1\
**Last updated:** [January 15, 2010, 2:58pm UTC](https://www.ruby-forum.com/t/is-there-a-simply-way-to-check-if-two-models-are-associated/181655 "2010-01-15T14:58:03Z")

</div>

Hey guys, I spent last night trawling through the rails API looking for some sort of @object1.associated\_with?(@object2) and couldn’t find anything, but it seems so fundamental… Does anything like this exist? if not…

---

## [Request large error](https://www.ruby-forum.com/t/request-large-error/181650)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 5\
**Last updated:** [January 15, 2010, 11:10am UTC](https://www.ruby-forum.com/t/request-large-error/181650 "2010-01-15T11:10:23Z")

</div>

Hello friends, \<%= link\_to “Generate Report”, {:action =\> ‘generate\_report’ ,:users =\> all\_users.map{|u| u.id}.join(",")}%\> The above action generates report for the users. As per the filter results the all\_users arr…

---

## [Modules/Mixins and accessing the calling object?](https://www.ruby-forum.com/t/modules-mixins-and-accessing-the-calling-object/181609)

<div class="topic-metadata">

**Author:** [@Arne-Kolja\_Bachstei](https://www.ruby-forum.com/u/Arne-Kolja_Bachstei)\
**Replies:** 1\
**Last updated:** [January 15, 2010, 11:02am UTC](https://www.ruby-forum.com/t/modules-mixins-and-accessing-the-calling-object/181609 "2010-01-15T11:02:47Z")

</div>

Hello there, I am stuck at a problem regarding modules here. I have a module that’s included in my model and I need to get to know the class name of my model from within the module. Problem is, that “self” is always …

---

## [Safer version of update\_attributes](https://www.ruby-forum.com/t/safer-version-of-update-attributes/181602)

<div class="topic-metadata">

**Author:** [@dukael](https://www.ruby-forum.com/u/dukael)\
**Replies:** 9\
**Last updated:** [January 15, 2010, 8:06am UTC](https://www.ruby-forum.com/t/safer-version-of-update-attributes/181602 "2010-01-15T08:06:07Z")

</div>

Hi, I was just working with a model where I am using attr\_protected as only certain attributes should be set depending on the context and I was wondering if there is a convention when it comes to setting multiple pro…

---

## [Re: Fwd: 500 error in sending bulk mail](https://www.ruby-forum.com/t/re-fwd-500-error-in-sending-bulk-mail/181646)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [January 15, 2010, 6:38am UTC](https://www.ruby-forum.com/t/re-fwd-500-error-in-sending-bulk-mail/181646 "2010-01-15T06:38:49Z")

</div>

I would look at something like delayed\_job first then worry about the rest… On Fri, Jan 15, 2010 at 7:23 AM, removed\_email\_address@domain.invalid wrote: Hi All i started a project one year before…form this notificati…

---

## [Inheritance\_column issues](https://www.ruby-forum.com/t/inheritance-column-issues/89039)

<div class="topic-metadata">

**Author:** [@patcito](https://www.ruby-forum.com/u/patcito)\
**Replies:** 2\
**Last updated:** [January 15, 2010, 5:50am UTC](https://www.ruby-forum.com/t/inheritance-column-issues/89039 "2010-01-15T05:50:24Z")

</div>

hey all, I have a table like that: devices( id int(5) uid int(5) type varchar(5) ) this is my model: class Rdevice \< ActiveRecord::Base set\_table\_name “devices” end for legacy reason I cannot change the column…

---

## [Activerecord 2.3.5's create & find slower than activerecord 2.1.2?](https://www.ruby-forum.com/t/activerecord-2-3-5s-create-find-slower-than-activerecord-2-1-2/181614)

<div class="topic-metadata">

**Author:** [@nbits](https://www.ruby-forum.com/u/nbits)\
**Replies:** 4\
**Last updated:** [January 15, 2010, 5:14am UTC](https://www.ruby-forum.com/t/activerecord-2-3-5s-create-find-slower-than-activerecord-2-1-2/181614 "2010-01-15T05:14:33Z")

</div>

Can anyone help me understand what’s going on here? We updated one of our apps from 2.1.2 to 2.3.5 hoping largely to get a little performance boost since I know there was a lot of performance improvements in the 2.3.…

---

## [Sharing unit tests across models](https://www.ruby-forum.com/t/sharing-unit-tests-across-models/181563)

<div class="topic-metadata">

**Author:** [@acreadinglist](https://www.ruby-forum.com/u/acreadinglist)\
**Replies:** 4\
**Last updated:** [January 15, 2010, 3:10am UTC](https://www.ruby-forum.com/t/sharing-unit-tests-across-models/181563 "2010-01-15T03:10:13Z")

</div>

Is there a way (or a best way) to share a test across models? For example, if I have two models that validate presence of :name, can I write just one shared unit test to check it (and point the models to the shared te…

---

## [Making the distinction between similarly titled links in Cuc](https://www.ruby-forum.com/t/making-the-distinction-between-similarly-titled-links-in-cuc/181612)

<div class="topic-metadata">

**Author:** [@kuramonni](https://www.ruby-forum.com/u/kuramonni)\
**Replies:** 1\
**Last updated:** [January 15, 2010, 3:03am UTC](https://www.ruby-forum.com/t/making-the-distinction-between-similarly-titled-links-in-cuc/181612 "2010-01-15T03:03:52Z")

</div>

Hoblaa! I’m writing a test for modifying a list structure. Say I have a list of objects in the view along the lines of: Object1 View Edit Delete Object2 View Edit Delete Object3 View Edit Delete Object4 Vie…

---

## [Multiple validations on a field... grouping them? only one?](https://www.ruby-forum.com/t/multiple-validations-on-a-field-grouping-them-only-one/181509)

<div class="topic-metadata">

**Author:** [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Replies:** 12\
**Last updated:** [January 15, 2010, 2:44am UTC](https://www.ruby-forum.com/t/multiple-validations-on-a-field-grouping-them-only-one/181509 "2010-01-15T02:44:41Z")

</div>

Hello! Has anyone come across a nice, elegant way to handle multiple validation failures on a single field? For example… in the typical login, you might have an email field that has three validations: not blank, less…

---

## [Router and OPTIONS](https://www.ruby-forum.com/t/router-and-options/181639)

<div class="topic-metadata">

**Author:** [@Guilherme\_Silveira](https://www.ruby-forum.com/u/Guilherme_Silveira)\
**Replies:** 0\
**Last updated:** [January 15, 2010, 2:37am UTC](https://www.ruby-forum.com/t/router-and-options/181639 "2010-01-15T02:37:06Z")

</div>

Hello guys, Given the request URI, how can I locate all controller actions routed to it? (different http methods will be mapped to such URI). Regards

---

## [Duplicate joins with eager loading + include?](https://www.ruby-forum.com/t/duplicate-joins-with-eager-loading-include/181629)

<div class="topic-metadata">

**Author:** [@cjnkns](https://www.ruby-forum.com/u/cjnkns)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 11:51pm UTC](https://www.ruby-forum.com/t/duplicate-joins-with-eager-loading-include/181629 "2010-01-14T23:51:59Z")

</div>

I am working on a centralized authorization framework. I have models for: App, Permission, and Role. In app.rb: has\_many :admins, :through =\> :permissions, :source =\> :user, :include =\> :roles, :conditions =\> \[‘role…

---

## [Changing default path for layouts](https://www.ruby-forum.com/t/changing-default-path-for-layouts/181627)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 2\
**Last updated:** [January 14, 2010, 11:32pm UTC](https://www.ruby-forum.com/t/changing-default-path-for-layouts/181627 "2010-01-14T23:32:31Z")

</div>

I’ve combed over the api, the classes, and even the file itself and I can’t seem to figure it out. The closest line I can find that shows a relevant area of the layout I wish to change is undocumented in layout.rb of …

---

## [Returning search result to new.html.erb as textfield value](https://www.ruby-forum.com/t/returning-search-result-to-new-html-erb-as-textfield-value/181622)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 9:01pm UTC](https://www.ruby-forum.com/t/returning-search-result-to-new-html-erb-as-textfield-value/181622 "2010-01-14T21:01:13Z")

</div>

Hello all, I have a link on my “new.html.erb” for new projects called "Add IRB(s). When clicked, this will produce a jquery ui dialog box rendering a search form with button. when I click the search button with a sea…

---

## [Page caching on hosted server not working](https://www.ruby-forum.com/t/page-caching-on-hosted-server-not-working/181616)

<div class="topic-metadata">

**Author:** [@jimmy](https://www.ruby-forum.com/u/jimmy)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 7:42pm UTC](https://www.ruby-forum.com/t/page-caching-on-hosted-server-not-working/181616 "2010-01-14T19:42:36Z")

</div>

I added page caching to my rails application, the production server was to write a cached version of the page but instead I get the following error in my log files when I access live.ochcnutrition.com/ about/ Errno::…

---

## [Typecasting ActiveRecord Find Results](https://www.ruby-forum.com/t/typecasting-activerecord-find-results/181608)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/typecasting-activerecord-find-results/181608 "2010-01-14T15:52:21Z")

</div>

If you run a query such as the following: Group.find(:select =\> ‘group.name, COUNT(members) as member\_count’, :joins =\> :members, :group =\> ‘group’) All of the sql calculations (e.g. member\_count) are typecast as str…

---

## [Validates\_inclusion\_of on boolean within file fails](https://www.ruby-forum.com/t/validates-inclusion-of-on-boolean-within-file-fails/181518)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 4\
**Last updated:** [January 14, 2010, 3:09pm UTC](https://www.ruby-forum.com/t/validates-inclusion-of-on-boolean-within-file-fails/181518 "2010-01-14T15:09:16Z")

</div>

Well I’m making a lot of headway with reading an uploaded yml file that contains values that are read and then inserted into the model. The formatted .yml file now looks like this: theme: name: My Theme author: Joh…

---

## [Emulate\_booleans for a specific connection](https://www.ruby-forum.com/t/emulate-booleans-for-a-specific-connection/181539)

<div class="topic-metadata">

**Author:** [@nerd](https://www.ruby-forum.com/u/nerd)\
**Replies:** 3\
**Last updated:** [January 14, 2010, 2:54pm UTC](https://www.ruby-forum.com/t/emulate-booleans-for-a-specific-connection/181539 "2010-01-14T14:54:25Z")

</div>

Hello, I’m running an environment with connections to different types of databases (using AR) in addition to the default mysql(5) connection. The MSSQL-Connections are working fine. Just one “old” 3rd party database …

---

## [Problem with polymorphic](https://www.ruby-forum.com/t/problem-with-polymorphic/181568)

<div class="topic-metadata">

**Author:** [@zumus](https://www.ruby-forum.com/u/zumus)\
**Replies:** 3\
**Last updated:** [January 14, 2010, 2:29pm UTC](https://www.ruby-forum.com/t/problem-with-polymorphic/181568 "2010-01-14T14:29:50Z")

</div>

Hi all! I have a strange problem when i try to use polymorphic associations in my app. I have a simple relations between my models: class Item \< ActiveRecord::Base belongs\_to :content, :polymorphic =\> true, :dependent…

---

## [Script/generate not working ! while rails do](https://www.ruby-forum.com/t/script-generate-not-working-while-rails-do/181485)

<div class="topic-metadata">

**Author:** [@fell](https://www.ruby-forum.com/u/fell)\
**Replies:** 8\
**Last updated:** [January 14, 2010, 2:27pm UTC](https://www.ruby-forum.com/t/script-generate-not-working-while-rails-do/181485 "2010-01-14T14:27:29Z")

</div>

Hi Strange thing happens when i run rails project it makes project but when i run script/generate or script/server it writes Missing the Rails 2.3.5 gem. Please gem install -v=2.3.5 rails, update your RAILS\_GEM\_VERSI…

---

## [Advise: popups for the views](https://www.ruby-forum.com/t/advise-popups-for-the-views/181545)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 1\
**Last updated:** [January 14, 2010, 2:20pm UTC](https://www.ruby-forum.com/t/advise-popups-for-the-views/181545 "2010-01-14T14:20:28Z")

</div>

hi, i woould like to have popup windows for certain views, eg the NEW view, so that as soon the create is done, i can close that window and reload the main “list” in the back… so my question is: what are the easiest/…

---

## [I want to start contributing patches](https://www.ruby-forum.com/t/i-want-to-start-contributing-patches/181599)

<div class="topic-metadata">

**Author:** [@JordanW](https://www.ruby-forum.com/u/JordanW)\
**Replies:** 1\
**Last updated:** [January 14, 2010, 12:00pm UTC](https://www.ruby-forum.com/t/i-want-to-start-contributing-patches/181599 "2010-01-14T12:00:00Z")

</div>

I would like to start contributing patches to the rails codebase in order to give something back to the community that has helped me so much. Is there a master list of open issues that I could begin looking into? Tha…

---

## [How can I add another model to ActionView::Base.field\_error\_proc?](https://www.ruby-forum.com/t/how-can-i-add-another-model-to-actionview-base-field-error-proc/181598)

<div class="topic-metadata">

**Author:** [@patrick99e99](https://www.ruby-forum.com/u/patrick99e99)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 11:59am UTC](https://www.ruby-forum.com/t/how-can-i-add-another-model-to-actionview-base-field-error-proc/181598 "2010-01-14T11:59:25Z")

</div>

Hi, If I have a form that has attributes for two different models-- if I do .valid? checks on both instances of the model in the create action of the controller, then I effectively generate error messages for both m…

---

## [Passenger multiple ruby processes problem](https://www.ruby-forum.com/t/passenger-multiple-ruby-processes-problem/181596)

<div class="topic-metadata">

**Author:** [@sumwutdum](https://www.ruby-forum.com/u/sumwutdum)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 10:26am UTC](https://www.ruby-forum.com/t/passenger-multiple-ruby-processes-problem/181596 "2010-01-14T10:26:12Z")

</div>

Hi ruby newbie here, We are running a single app on a passenger server. We are getting a couple of errors when concurrent requests are being processed on our server. e.g. \[ pid=19771 file=ext/apache2/Hooks.cpp:546 t…

---

## [More virtual hosts on one rails application](https://www.ruby-forum.com/t/more-virtual-hosts-on-one-rails-application/181593)

<div class="topic-metadata">

**Author:** [@Fifigyuri](https://www.ruby-forum.com/u/Fifigyuri)\
**Replies:** 0\
**Last updated:** [January 14, 2010, 9:49am UTC](https://www.ruby-forum.com/t/more-virtual-hosts-on-one-rails-application/181593 "2010-01-14T09:49:28Z")

</div>

How can I access one rails application through more virtual hosts. The different virtual hosts would differ in the database, images, stylesheets and in some cases the layout of the views. What do you recommend for rea…

---

## [Jquery works in development but doesn't work when hosted on hostingrails.com](https://www.ruby-forum.com/t/jquery-works-in-development-but-doesnt-work-when-hosted-on-hostingrails-com/181537)

<div class="topic-metadata">

**Author:** [@rprateek](https://www.ruby-forum.com/u/rprateek)\
**Replies:** 3\
**Last updated:** [January 14, 2010, 9:33am UTC](https://www.ruby-forum.com/t/jquery-works-in-development-but-doesnt-work-when-hosted-on-hostingrails-com/181537 "2010-01-14T09:33:05Z")

</div>

i am a beginner to rails and this is my first project. Just tried something with jquery. It works fine in my development machine but jquery is not executed in my production page my site is http://www.khaire.com/galler…

---

## [User a owns resource x; don't let user b see user a's resources](https://www.ruby-forum.com/t/user-a-owns-resource-x-dont-let-user-b-see-user-as-resources/181523)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 3\
**Last updated:** [January 14, 2010, 8:10am UTC](https://www.ruby-forum.com/t/user-a-owns-resource-x-dont-let-user-b-see-user-as-resources/181523 "2010-01-14T08:10:34Z")

</div>

I have a system of users who have many resources. For example a user many have many books, many friends, many items, etc. I have an authentication system in which users can login working just fine (authlogic). However…

---

## [Uninitialized Constant Using New S3 Library](https://www.ruby-forum.com/t/uninitialized-constant-using-new-s3-library/78113)

<div class="topic-metadata">

**Author:** [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Replies:** 1\
**Last updated:** [January 14, 2010, 8:00am UTC](https://www.ruby-forum.com/t/uninitialized-constant-using-new-s3-library/78113 "2010-01-14T08:00:58Z")

</div>

I am trying to use the new S3 library (thanks Marcel!) but I am getting an Uninitialized Constant message: Service.buckets NameError: uninitialized constant Service from /opt/local/lib/ruby/gems/1.8/gems/activesupp…

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

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