# Rails

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

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

---

## [How to get id of other table](https://www.ruby-forum.com/t/how-to-get-id-of-other-table/173420)

<div class="topic-metadata">

**Author:** [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Replies:** 4\
**Last updated:** [August 10, 2009, 9:04am UTC](https://www.ruby-forum.com/t/how-to-get-id-of-other-table/173420 "2009-08-10T09:04:55Z")

</div>

Hi All, I have a doubt regarding join tables I’m having 2 models 1)Fac 2)Cont and both models have " has and belong to many" relationships so there are 3 tables 1)facs 2)conts 3)conts\_facs then i’m fetching the…

---

## [REST and confirmation page routing](https://www.ruby-forum.com/t/rest-and-confirmation-page-routing/173469)

<div class="topic-metadata">

**Author:** [@Hunt\_J](https://www.ruby-forum.com/u/Hunt_J)\
**Replies:** 0\
**Last updated:** [August 10, 2009, 5:23am UTC](https://www.ruby-forum.com/t/rest-and-confirmation-page-routing/173469 "2009-08-10T05:23:04Z")

</div>

Hi I’m new to Rails. I need to make a simple CRUD website. I need a dedicate confirmation/preview page for each “create”, “update” and “delete” action. For the “delete”, I cannot use a JavaScript pop up function. In…

---

## [A rails sitemap plugin](https://www.ruby-forum.com/t/a-rails-sitemap-plugin/173471)

<div class="topic-metadata">

**Author:** [@flyerhzm](https://www.ruby-forum.com/u/flyerhzm)\
**Replies:** 0\
**Last updated:** [August 10, 2009, 3:38am UTC](https://www.ruby-forum.com/t/a-rails-sitemap-plugin/173471 "2009-08-10T03:38:53Z")

</div>

Hi, guys: I wrote a sitemap plugin for rails yesterday. This plugin will generate the public/sitemap.xml from config/sitemap.rb whose format is very familiar to config/routes.rb. I think it is very helpful if you hav…

---

## [CDN for Rails - any recommendations?](https://www.ruby-forum.com/t/cdn-for-rails-any-recommendations/173466)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 2\
**Last updated:** [August 10, 2009, 3:13am UTC](https://www.ruby-forum.com/t/cdn-for-rails-any-recommendations/173466 "2009-08-10T03:13:20Z")

</div>

Are there any good recommendations for CDN’s (Content Delivery Networks) for use with Rails? I was looking at Amazon Cloudfront but am just curious if anyone has used CDNs with rails and whether or not you find a par…

---

## [How to use â€˜constantizeâ€™ in custom contr oller module](https://www.ruby-forum.com/t/how-to-use-a-constantizea-in-custom-contr-oller-module/173458)

<div class="topic-metadata">

**Author:** [@boblu](https://www.ruby-forum.com/u/boblu)\
**Replies:** 2\
**Last updated:** [August 10, 2009, 2:32am UTC](https://www.ruby-forum.com/t/how-to-use-a-constantizea-in-custom-contr-oller-module/173458 "2009-08-10T02:32:46Z")

</div>

I have a module like this: module Controller module LocaleModels def self.included(base) base.send :include, InstanceMethods end module InstanceMethods def locale\_Lexeme; constantize\_model('Lexeme') end def loc…

---

## [Options in command line in scaffold generations](https://www.ruby-forum.com/t/options-in-command-line-in-scaffold-generations/173467)

<div class="topic-metadata">

**Author:** [@Pavel](https://www.ruby-forum.com/u/Pavel)\
**Replies:** 1\
**Last updated:** [August 10, 2009, 1:51am UTC](https://www.ruby-forum.com/t/options-in-command-line-in-scaffold-generations/173467 "2009-08-10T01:51:47Z")

</div>

I write: ./script/generate manage\_scaffold product PARENT=structure but, when I try to use ENV\[‘PARENT’\] it always is nil value. How can I get parameter value from option in command line, when scaffold is generating …

---

## [\[ANN\] Lone Star Ruby Conference 2009 - 18 More Days till Showdown](https://www.ruby-forum.com/t/ann-lone-star-ruby-conference-2009-18-more-days-till-showdown/196988)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [August 10, 2009, 1:39am UTC](https://www.ruby-forum.com/t/ann-lone-star-ruby-conference-2009-18-more-days-till-showdown/196988 "2009-08-10T01:39:30Z")

</div>

Greetings from Austin - Home of the Lone Star Ruby Conference. This year we are catering to your every desire. In addition to the customary luxuries you have come to expect at LSRC, like the awesome food or the power…

---

## [Re-initialising page after validation fails](https://www.ruby-forum.com/t/re-initialising-page-after-validation-fails/173424)

<div class="topic-metadata">

**Author:** [@akm](https://www.ruby-forum.com/u/akm)\
**Replies:** 2\
**Last updated:** [August 10, 2009, 12:53am UTC](https://www.ruby-forum.com/t/re-initialising-page-after-validation-fails/173424 "2009-08-10T00:53:14Z")

</div>

Hi, I have a controller and two of the actions in it are as follows: GET /bids/new GET /bids/new.xml def new @bid = Bid.new @auctionItems = AuctionItem.find(:all) respond\_to do |format| format.html # new.html.erb …

---

## [Relationships not working](https://www.ruby-forum.com/t/relationships-not-working/173465)

<div class="topic-metadata">

**Author:** [@sweetie\_lolz3](https://www.ruby-forum.com/u/sweetie_lolz3)\
**Replies:** 2\
**Last updated:** [August 10, 2009, 12:06am UTC](https://www.ruby-forum.com/t/relationships-not-working/173465 "2009-08-10T00:06:51Z")

</div>

I’ve just stated programming with Ruby on Rails a few days ago. I’m trying to set up a simple Blog. To this point I have a Posts.rb model and controller and a comments.rb model and controller with a “has\_many :comment…

---

## [Changing from database sqlite3 to mysql - windows](https://www.ruby-forum.com/t/changing-from-database-sqlite3-to-mysql-windows/173331)

<div class="topic-metadata">

**Author:** [@walt](https://www.ruby-forum.com/u/walt)\
**Replies:** 20\
**Last updated:** [August 10, 2009, 12:00am UTC](https://www.ruby-forum.com/t/changing-from-database-sqlite3-to-mysql-windows/173331 "2009-08-10T00:00:01Z")

</div>

Hi Guys I’d like to know how to change from using sqlite3 to mysql. I’m running windows xp. What is the command that I must type under my application folder? How to I log into the mysql database afterwards? My databa…

---

## [Error while installing ruby-postgres gem](https://www.ruby-forum.com/t/error-while-installing-ruby-postgres-gem/173456)

<div class="topic-metadata">

**Author:** [@jai](https://www.ruby-forum.com/u/jai)\
**Replies:** 1\
**Last updated:** [August 9, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/error-while-installing-ruby-postgres-gem/173456 "2009-08-09T21:55:59Z")

</div>

Hi, I am new to Ruby on Rails. I am running rails on Mac OSX 10.5.7. I get an error when I run this command sudo gem install ruby-postgres The error is as follows /System/Library/Frameworks/Ruby.framework/Versions/1.8…

---

## [Formhelper somehow?](https://www.ruby-forum.com/t/formhelper-somehow/173463)

<div class="topic-metadata">

**Author:** [@RVince](https://www.ruby-forum.com/u/RVince)\
**Replies:** 0\
**Last updated:** [August 9, 2009, 9:50pm UTC](https://www.ruby-forum.com/t/formhelper-somehow/173463 "2009-08-09T21:50:04Z")

</div>

I have a select box, which is a javascript mashup that allows for an editable select (i.e. index 0 is editable). I have it specified in nearly straight html / js in my .html.erb form. The option values \> 0 I would li…

---

## [Validates\_format\_of](https://www.ruby-forum.com/t/validates-format-of/173423)

<div class="topic-metadata">

**Author:** [@akm](https://www.ruby-forum.com/u/akm)\
**Replies:** 12\
**Last updated:** [August 9, 2009, 7:21pm UTC](https://www.ruby-forum.com/t/validates-format-of/173423 "2009-08-09T19:21:00Z")

</div>

Hi, I have this in one of my models: validates\_format\_of :amount, :with =\> /\\A\[0-9\]{1,5}.\[0-9\]{2}\\Z/ If I enter an amount that ends with “.00”, eg. 123.00 or 300.00 it fails, and I cannot understand why. It works wi…

---

## [RichTextEditor](https://www.ruby-forum.com/t/richtexteditor/173409)

<div class="topic-metadata">

**Author:** [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Replies:** 7\
**Last updated:** [August 9, 2009, 6:22pm UTC](https://www.ruby-forum.com/t/richtexteditor/173409 "2009-08-09T18:22:52Z")

</div>

Hi, Which is the most advisable Rich Text Editor plugin / gem to use? Please advise

---

## [Formating date and time](https://www.ruby-forum.com/t/formating-date-and-time/173419)

<div class="topic-metadata">

**Author:** [@aashishkiran](https://www.ruby-forum.com/u/aashishkiran)\
**Replies:** 3\
**Last updated:** [August 9, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/formating-date-and-time/173419 "2009-08-09T17:55:21Z")

</div>

I want to display date and time in view as “August 7, 2009 at 10:22:02 am”. Presently it is displaying in view as “2009-08-07 10:22:02 UTC”. Can anyone tell to format date and time.

---

## [Div is shown only from the layout nowhere else](https://www.ruby-forum.com/t/div-is-shown-only-from-the-layout-nowhere-else/170768)

<div class="topic-metadata">

**Author:** [@little\_kostas](https://www.ruby-forum.com/u/little_kostas)\
**Replies:** 8\
**Last updated:** [August 9, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/div-is-shown-only-from-the-layout-nowhere-else/170768 "2009-08-09T17:20:13Z")

</div>

Hi guys! I have a little problem with my code. I have a div in my store layout, inside of which i have my cart. When i put something in the cart i get an AJAX blind\_down and a replace\_html. I can see the cart when i a…

---

## [Shared partial working with controller](https://www.ruby-forum.com/t/shared-partial-working-with-controller/173298)

<div class="topic-metadata">

**Author:** [@little\_kostas](https://www.ruby-forum.com/u/little_kostas)\
**Replies:** 2\
**Last updated:** [August 9, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/shared-partial-working-with-controller/173298 "2009-08-09T17:07:55Z")

</div>

Hi guys, iam just wondering, can i use a shared partial with a controller? In my project, i have in my views folder, a shared\_partials folder where i put my partials. In my controller eg books\_controller i make a sea…

---

## [AR finder with include only specific value](https://www.ruby-forum.com/t/ar-finder-with-include-only-specific-value/173451)

<div class="topic-metadata">

**Author:** [@aldoitalo](https://www.ruby-forum.com/u/aldoitalo)\
**Replies:** 2\
**Last updated:** [August 9, 2009, 2:16pm UTC](https://www.ruby-forum.com/t/ar-finder-with-include-only-specific-value/173451 "2009-08-09T14:16:46Z")

</div>

i have a model :user with an association has\_many :langs. table langs have fields title and langcode. In practice every users have many langs, i retrieve specific lang with the langcode (en, de, fr, it, es, etc.) Now…

---

## [Why partial doesn't work?](https://www.ruby-forum.com/t/why-partial-doesnt-work/173440)

<div class="topic-metadata">

**Author:** [@webstic](https://www.ruby-forum.com/u/webstic)\
**Replies:** 9\
**Last updated:** [August 9, 2009, 1:25pm UTC](https://www.ruby-forum.com/t/why-partial-doesnt-work/173440 "2009-08-09T13:25:07Z")

</div>

im getting: undefined local variable or method \`post’ for #ActionView::Base:0x2673624 where in my code i have the mistake ? please help… code at index.html.erb welcome to my weblog! \<%= render :partial =\> "posts…

---

## [Top Senior Level RoR Engineer - Backend](https://www.ruby-forum.com/t/top-senior-level-ror-engineer-backend/172860)

<div class="topic-metadata">

**Author:** [@Marta\_Daglow](https://www.ruby-forum.com/u/Marta_Daglow)\
**Replies:** 2\
**Last updated:** [August 9, 2009, 2:04am UTC](https://www.ruby-forum.com/t/top-senior-level-ror-engineer-backend/172860 "2009-08-09T02:04:58Z")

</div>

Senior Level RoR Engineer - Backend My client (located in SOMA) is a leading developer and provider of email marketing applications. This organization of 50 people is growing and has an impressive customer list. The …

---

## [Proxy recommendations?](https://www.ruby-forum.com/t/proxy-recommendations/173438)

<div class="topic-metadata">

**Author:** [@Hassan\_S](https://www.ruby-forum.com/u/Hassan_S)\
**Replies:** 2\
**Last updated:** [August 9, 2009, 12:17am UTC](https://www.ruby-forum.com/t/proxy-recommendations/173438 "2009-08-09T00:17:17Z")

</div>

Sorta OT, sorta not. :slight\_smile: I want to put a {something} in front of multiple app servers in order to be able to do rolling updates by quiescing traffic to one, updating it, starting it, sleep 'til ready, enabl…

---

## [Date\_select - Specifying an id for each selector fails](https://www.ruby-forum.com/t/date-select-specifying-an-id-for-each-selector-fails/173439)

<div class="topic-metadata">

**Author:** [@Lb2007](https://www.ruby-forum.com/u/Lb2007)\
**Replies:** 1\
**Last updated:** [August 9, 2009, 12:00am UTC](https://www.ruby-forum.com/t/date-select-specifying-an-id-for-each-selector-fails/173439 "2009-08-09T00:00:19Z")

</div>

Because of some third party dependencies I’m trying to use a date\_select helper (actually datetime, but they behave the same) whilst specifying an ID for each of the three selectors (day/month/ year). \<%= f.date\_sele…

---

## [Wamp doesn't work after installing with InstantRails](https://www.ruby-forum.com/t/wamp-doesnt-work-after-installing-with-instantrails/173421)

<div class="topic-metadata">

**Author:** [@JCJCJC](https://www.ruby-forum.com/u/JCJCJC)\
**Replies:** 5\
**Last updated:** [August 8, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/wamp-doesnt-work-after-installing-with-instantrails/173421 "2009-08-08T19:33:28Z")

</div>

Hello. I installed ROR with InstantRails and it works fine. But later, when I tried to access to localhost via wamp, wamp didn’t work. (I have previous projects sitting in ‘C:\\wamp\\www’ folder, and I used to access …

---

## [Acts\_as\_tree](https://www.ruby-forum.com/t/acts-as-tree/173239)

<div class="topic-metadata">

**Author:** [@djames](https://www.ruby-forum.com/u/djames)\
**Replies:** 9\
**Last updated:** [August 8, 2009, 6:57pm UTC](https://www.ruby-forum.com/t/acts-as-tree/173239 "2009-08-08T18:57:06Z")

</div>

My goal is to use nested elements to display a hierarchical view of an entire table. It is my understanding that all acts\_as\_tree does is make available 3 additional methods: ‘ancestors’, ‘root’, and ‘siblings’. A…

---

## [A weird database association](https://www.ruby-forum.com/t/a-weird-database-association/173397)

<div class="topic-metadata">

**Author:** [@jasonb](https://www.ruby-forum.com/u/jasonb)\
**Replies:** 3\
**Last updated:** [August 8, 2009, 6:56pm UTC](https://www.ruby-forum.com/t/a-weird-database-association/173397 "2009-08-08T18:56:38Z")

</div>

I’m trying to figure out a way to create this relationship: a user has many friends which are themselves users I have an existing ‘users’ table in the database. I’ve created a ‘friends’ database with: id: integer us…

---

## [Set only one observer to be active in a test](https://www.ruby-forum.com/t/set-only-one-observer-to-be-active-in-a-test/173432)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 2\
**Last updated:** [August 8, 2009, 6:14pm UTC](https://www.ruby-forum.com/t/set-only-one-observer-to-be-active-in-a-test/173432 "2009-08-08T18:14:16Z")

</div>

In my environment.rb I set a whole bunch of observers to be active by default. In testing I don’t want to do that, I want to turn observers on and off as required so that I can isolate the things I’m testing. How do I…

---

## [ERROR: While generating documentation for mysql-2.7.3-x86-m](https://www.ruby-forum.com/t/error-while-generating-documentation-for-mysql-2-7-3-x86-m/173234)

<div class="topic-metadata">

**Author:** [@yvar\_trust](https://www.ruby-forum.com/u/yvar_trust)\
**Replies:** 1\
**Last updated:** [August 8, 2009, 6:09pm UTC](https://www.ruby-forum.com/t/error-while-generating-documentation-for-mysql-2-7-3-x86-m/173234 "2009-08-08T18:09:26Z")

</div>

gem install mysql gem install mysql Successfully installed mysql-2.7.3-x86-mswin32 1 gem installed Installing ri documentation for mysql-2.7.3-x86-mswin32… Installing RDoc documentation for mysql-2.7.3-x86-mswin32… …

---

## [Postgresql schema support](https://www.ruby-forum.com/t/postgresql-schema-support/173433)

<div class="topic-metadata">

**Author:** [@Ilya\_Dyoshin](https://www.ruby-forum.com/u/Ilya_Dyoshin)\
**Replies:** 0\
**Last updated:** [August 8, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/postgresql-schema-support/173433 "2009-08-08T17:56:13Z")

</div>

Good day, Reading this I understand the structure ‘schema.table\_name’ for postgresql is supported in Rails 2.3.x but I’m still having errors like relation “schema.table\_name” doesn’t exists Any idea? Best regar…

---

## [How do I report a Rails bug?](https://www.ruby-forum.com/t/how-do-i-report-a-rails-bug/173431)

<div class="topic-metadata">

**Author:** [@aftershock](https://www.ruby-forum.com/u/aftershock)\
**Replies:** 2\
**Last updated:** [August 8, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/how-do-i-report-a-rails-bug/173431 "2009-08-08T17:50:49Z")

</div>

Just as the title sais really. How should I go about reporting a bug in Rails 2.3.2 and 2.3.3? Thanks James

---

## [Moving Permission Logic to the Model](https://www.ruby-forum.com/t/moving-permission-logic-to-the-model/173395)

<div class="topic-metadata">

**Author:** [@coolaj86](https://www.ruby-forum.com/u/coolaj86)\
**Replies:** 2\
**Last updated:** [August 8, 2009, 5:42pm UTC](https://www.ruby-forum.com/t/moving-permission-logic-to-the-model/173395 "2009-08-08T17:42:09Z")

</div>

Ideally what I would like to have happen: Contact.find (and .find\_by\_xyz, etc) will never return a contact unless contact.group is IN current\_user.contact.group.supergroup.groups Scenario: User belongs to a Contact. …

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

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