# Rails

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

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

---

## [Factory\_girl: build associated object](https://www.ruby-forum.com/t/factory-girl-build-associated-object/182579)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 0\
**Last updated:** [January 30, 2010, 9:33am UTC](https://www.ruby-forum.com/t/factory-girl-build-associated-object/182579 "2010-01-30T09:33:31Z")

</div>

I am using factory girl to build the following objects: user and blog. A user has one blog. A blog belongs to a user. When I do the following Factory.define :user do |u| u.association :blog end I get this error: …

---

## [Best way to do this](https://www.ruby-forum.com/t/best-way-to-do-this/182570)

<div class="topic-metadata">

**Author:** [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Replies:** 5\
**Last updated:** [January 30, 2010, 4:52am UTC](https://www.ruby-forum.com/t/best-way-to-do-this/182570 "2010-01-30T04:52:58Z")

</div>

I’m looking to give an object (buyer) a status. What’s the best way to accomplish this? At the moment, I’m struggling to comprehend my way through the following: Create a status model, then let the user add statuse…

---

## [Authlogic](https://www.ruby-forum.com/t/authlogic/182372)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 4\
**Last updated:** [January 30, 2010, 4:48am UTC](https://www.ruby-forum.com/t/authlogic/182372 "2010-01-30T04:48:09Z")

</div>

Hi I am using authlogic version 2.1.3. I have two models companies and users. company has\_many users user belongs\_to company Upon registration one company and a user is created at the same time. And the flow is af…

---

## [Files are missing in rails app](https://www.ruby-forum.com/t/files-are-missing-in-rails-app/182442)

<div class="topic-metadata">

**Author:** [@geethasg](https://www.ruby-forum.com/u/geethasg)\
**Replies:** 5\
**Last updated:** [January 30, 2010, 4:35am UTC](https://www.ruby-forum.com/t/files-are-missing-in-rails-app/182442 "2010-01-30T04:35:06Z")

</div>

I’ve built the slackware packages of rails. rails path is: /frm/ruby/1.8.6/lib/ruby/site\_ruby/1.8 RUBYLIB : /frm/ruby/1.8.6/lib/ruby/site\_ruby/1.8:/frm/ruby/1.8.6/lib/ruby/site\_ruby/1.8/i686-linux/ I could created th…

---

## [Rails console not loading my model properly](https://www.ruby-forum.com/t/rails-console-not-loading-my-model-properly/182564)

<div class="topic-metadata">

**Author:** [@junkone1](https://www.ruby-forum.com/u/junkone1)\
**Replies:** 1\
**Last updated:** [January 30, 2010, 1:59am UTC](https://www.ruby-forum.com/t/rails-console-not-loading-my-model-properly/182564 "2010-01-30T01:59:26Z")

</div>

You can see below that when i load the console, it is not loading my model Comparetick. however after i perform a manual require, it is loading it correctly. i am not sure where to look for the issue. E:\\TradingToo…

---

## [Script/generate forum](https://www.ruby-forum.com/t/script-generate-forum/182552)

<div class="topic-metadata">

**Author:** [@al-evans](https://www.ruby-forum.com/u/al-evans)\
**Replies:** 1\
**Last updated:** [January 30, 2010, 12:29am UTC](https://www.ruby-forum.com/t/script-generate-forum/182552 "2010-01-30T00:29:29Z")

</div>

Hi, we can generate Model, Controller, Mailers… does anyone know of a generator for a forum? if anyone wants to develop one please get in touch, removed\_email\_address@domain.invalid

---

## [RoR hosting help?](https://www.ruby-forum.com/t/ror-hosting-help/182494)

<div class="topic-metadata">

**Author:** [@mike](https://www.ruby-forum.com/u/mike)\
**Replies:** 10\
**Last updated:** [January 30, 2010, 12:07am UTC](https://www.ruby-forum.com/t/ror-hosting-help/182494 "2010-01-30T00:07:24Z")

</div>

Hi, I am looking for suggestions for hosting for a site we’re developing in RoR (working with developer): The site allows photographers to upload galleries, so we want to make sure we have proper memory and bandwidth…

---

## [Rails 3 App generator - could not find source path](https://www.ruby-forum.com/t/rails-3-app-generator-could-not-find-source-path/182541)

<div class="topic-metadata">

**Author:** [@Kristian](https://www.ruby-forum.com/u/Kristian)\
**Replies:** 1\
**Last updated:** [January 30, 2010, 12:05am UTC](https://www.ruby-forum.com/t/rails-3-app-generator-could-not-find-source-path/182541 "2010-01-30T00:05:56Z")

</div>

Could not find “README” in source paths. module Nifty module Generators class AppGenerator \< Base def self.source\_root @source\_root ||= File.expand\_path(File.join(File.dirname (FILE), ‘templates’)) end def…

---

## [Requiring records in the DB before testing](https://www.ruby-forum.com/t/requiring-records-in-the-db-before-testing/182557)

<div class="topic-metadata">

**Author:** [@kkohrt](https://www.ruby-forum.com/u/kkohrt)\
**Replies:** 4\
**Last updated:** [January 29, 2010, 10:30pm UTC](https://www.ruby-forum.com/t/requiring-records-in-the-db-before-testing/182557 "2010-01-29T22:30:32Z")

</div>

Is there any way I can require a small set of data be in the test database before any tests are run? (unit, functional, integration, cucumber, etc) Any way besides using fixtures, that is. Overload a rake task? Modi…

---

## [Want to combine two searches into one](https://www.ruby-forum.com/t/want-to-combine-two-searches-into-one/182563)

<div class="topic-metadata">

**Author:** [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Replies:** 0\
**Last updated:** [January 29, 2010, 10:16pm UTC](https://www.ruby-forum.com/t/want-to-combine-two-searches-into-one/182563 "2010-01-29T22:16:48Z")

</div>

I would like to merge this method from a controller into a separate model, called search. class DudesController \< ApplicationController def search @address = params\[:address\] @within = params\[:within\] @dudes = Res…

---

## [Cucumber: fill\_in does not take label](https://www.ruby-forum.com/t/cucumber-fill-in-does-not-take-label/182562)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 0\
**Last updated:** [January 29, 2010, 10:11pm UTC](https://www.ruby-forum.com/t/cucumber-fill-in-does-not-take-label/182562 "2010-01-29T22:11:48Z")

</div>

In a Cucumber step, the following line will fill in the screen\_name text box: fill\_in “user\[screen\_name\]”, :with =\> user.screen\_name but the following line will not fill\_in “Screen name:”, :with =\> user.screen\_name H…

---

## [Super noob needs help](https://www.ruby-forum.com/t/super-noob-needs-help/182440)

<div class="topic-metadata">

**Author:** [@xafgx](https://www.ruby-forum.com/u/xafgx)\
**Replies:** 11\
**Last updated:** [January 29, 2010, 9:43pm UTC](https://www.ruby-forum.com/t/super-noob-needs-help/182440 "2010-01-29T21:43:07Z")

</div>

I am following video tutorials for rails. I am a part where i am suppose to write “scaffold :album” inside admin\_controller. "class AdminController \< ApplicationController scaffold :album end " I did that but i ge…

---

## [Memory, memory, memory](https://www.ruby-forum.com/t/memory-memory-memory/182556)

<div class="topic-metadata">

**Author:** [@PierreW](https://www.ruby-forum.com/u/PierreW)\
**Replies:** 1\
**Last updated:** [January 29, 2010, 9:38pm UTC](https://www.ruby-forum.com/t/memory-memory-memory/182556 "2010-01-29T21:38:07Z")

</div>

Hi guys, I am currently “hunting” leaks in my app, and either I don’t quite understand how ruby/rails handle memory, or there are some “features” of Rails I am not aware of. And indeed, I found - for example - this c…

---

## [Install gems problem in windows](https://www.ruby-forum.com/t/install-gems-problem-in-windows/182514)

<div class="topic-metadata">

**Author:** [@senling](https://www.ruby-forum.com/u/senling)\
**Replies:** 6\
**Last updated:** [January 29, 2010, 9:07pm UTC](https://www.ruby-forum.com/t/install-gems-problem-in-windows/182514 "2010-01-29T21:07:29Z")

</div>

Hi, I have installed ruby and trying to set rails environment. ruby -v ruby 1.8.6 (2007-09-24 patchlevel 111) \[i386-mswin32\] gem environment RubyGems Environment: VERSION: 0.9.4 (0.9.4) INSTALLATION DIRECTORY:…

---

## [Syntax error, unexpected keyword\_ensure, expecting $end](https://www.ruby-forum.com/t/syntax-error-unexpected-keyword-ensure-expecting-end/182547)

<div class="topic-metadata">

**Author:** [@vihrao](https://www.ruby-forum.com/u/vihrao)\
**Replies:** 3\
**Last updated:** [January 29, 2010, 8:09pm UTC](https://www.ruby-forum.com/t/syntax-error-unexpected-keyword-ensure-expecting-end/182547 "2010-01-29T20:09:43Z")

</div>

I call a test method on posting data to a signup form def test\_bad\_signup u = User.new post :signup, :user =\> { :login =\> “newbob”, :password =\> “newpassword”, :password\_confirmation =\> “wrong” , :email =\> “removed\_…

---

## [Best Practices; Deploying Updates](https://www.ruby-forum.com/t/best-practices-deploying-updates/182495)

<div class="topic-metadata">

**Author:** [@perezda](https://www.ruby-forum.com/u/perezda)\
**Replies:** 10\
**Last updated:** [January 29, 2010, 7:30pm UTC](https://www.ruby-forum.com/t/best-practices-deploying-updates/182495 "2010-01-29T19:30:14Z")

</div>

Hello, So I am a running a few shopping carts using spree (open source rails cart) and some of my clients site traffic is starting to rise. Normally I do deploy updates late at night but some times I have to deploy t…

---

## [Sql query confusion](https://www.ruby-forum.com/t/sql-query-confusion/182516)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 9\
**Last updated:** [January 29, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/sql-query-confusion/182516 "2010-01-29T18:24:05Z")

</div>

Hello champs, Scenario is that i have a table called “employee” and a column for manager\_id inside it… and another table called “leaves” and having a column employee\_id inside it… I am copying here one record… Employ…

---

## [Do you want to view only the webpage content that was deliev](https://www.ruby-forum.com/t/do-you-want-to-view-only-the-webpage-content-that-was-deliev/182527)

<div class="topic-metadata">

**Author:** [@hamidraza](https://www.ruby-forum.com/u/hamidraza)\
**Replies:** 1\
**Last updated:** [January 29, 2010, 6:18pm UTC](https://www.ruby-forum.com/t/do-you-want-to-view-only-the-webpage-content-that-was-deliev/182527 "2010-01-29T18:18:54Z")

</div>

How to disable it from code side so that user will not have to go to settings of IE and make it disable. code side solution is required.

---

## [Observe\_field and IE 8](https://www.ruby-forum.com/t/observe-field-and-ie-8/182512)

<div class="topic-metadata">

**Author:** [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Replies:** 1\
**Last updated:** [January 29, 2010, 5:47pm UTC](https://www.ruby-forum.com/t/observe-field-and-ie-8/182512 "2010-01-29T17:47:47Z")

</div>

I want to blame IE 8 because I designed with FF and did not see any issue but IE 8 definitely is a problem. To simplify a fairly complex page… LAYOUT.HTML.ERB \<% yield %\> LIST.HTML.ERB \<%= options = \[\[@menu\_top…

---

## [Gsub not working to replace a 'Chinese' Charater](https://www.ruby-forum.com/t/gsub-not-working-to-replace-a-chinese-charater/182473)

<div class="topic-metadata">

**Author:** [@dissolved](https://www.ruby-forum.com/u/dissolved)\
**Replies:** 3\
**Last updated:** [January 29, 2010, 5:03pm UTC](https://www.ruby-forum.com/t/gsub-not-working-to-replace-a-chinese-charater/182473 "2010-01-29T17:03:18Z")

</div>

gsub not works for me when replace ‘DBCS’(double byte character set) character, using last version ruby 1.8.6 when “stræ±‰å­—end”.gsub(/æ±‰å­—/,“hanzi”), output still is: stræ±‰å­—end , but not strhanziend which I wa…

---

## [Attr\_accessible question](https://www.ruby-forum.com/t/attr-accessible-question/182497)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [January 29, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/attr-accessible-question/182497 "2010-01-29T16:58:02Z")

</div>

Can one vary which attributes are available for mass assignment ? In other words, if I had this statement in a model attr\_accessible :a, :b:, :c is there some simple way to later add :d or remove :c?

---

## [Many to many relationship with restful routes](https://www.ruby-forum.com/t/many-to-many-relationship-with-restful-routes/182482)

<div class="topic-metadata">

**Author:** [@mpathare](https://www.ruby-forum.com/u/mpathare)\
**Replies:** 5\
**Last updated:** [January 29, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/many-to-many-relationship-with-restful-routes/182482 "2010-01-29T16:35:47Z")

</div>

Here is the scenario, Articles have many Comments Users can write many Comments for many Articles The comments table contains both user\_id article\_id as foreign keys My models are set up like so class User \< Activ…

---

## [Remote MSSQL database JDBC URL and driver](https://www.ruby-forum.com/t/remote-mssql-database-jdbc-url-and-driver/182537)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 0\
**Last updated:** [January 29, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/remote-mssql-database-jdbc-url-and-driver/182537 "2010-01-29T15:34:55Z")

</div>

Right now I’m connecting to a remote MSSQL db using sqljdbc4.jar from Netbeans, which works fine for Java. However, for Ruby (not Jruby, note), what’s best? Would this adapter work: I ask because the MSSQL db expe…

---

## [Generating one page with multiple controllers](https://www.ruby-forum.com/t/generating-one-page-with-multiple-controllers/182489)

<div class="topic-metadata">

**Author:** [@kapsel](https://www.ruby-forum.com/u/kapsel)\
**Replies:** 2\
**Last updated:** [January 29, 2010, 2:18pm UTC](https://www.ruby-forum.com/t/generating-one-page-with-multiple-controllers/182489 "2010-01-29T14:18:29Z")

</div>

Hi, So I have an application in rails. The purpose of the application is to display test results written to the database. Each test consists of several defined operations. Each operation can have multiple sub operati…

---

## [Adding div id leading to 500 internal server error in linu](https://www.ruby-forum.com/t/adding-div-id-leading-to-500-internal-server-error-in-linu/182520)

<div class="topic-metadata">

**Author:** [@keir](https://www.ruby-forum.com/u/keir)\
**Replies:** 1\
**Last updated:** [January 29, 2010, 1:33pm UTC](https://www.ruby-forum.com/t/adding-div-id-leading-to-500-internal-server-error-in-linu/182520 "2010-01-29T13:33:09Z")

</div>

Hi, When i am going to change the div id of an haml page on a linux system leading to 500 error. Example: index.html.haml Original code: #home-main #home-main-left #div-home-step-1 #div-home-step-2 #div-home-st…

---

## [Model.errors.add ... No attribute](https://www.ruby-forum.com/t/model-errors-add-no-attribute/182515)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 1\
**Last updated:** [January 29, 2010, 12:58pm UTC](https://www.ruby-forum.com/t/model-errors-add-no-attribute/182515 "2010-01-29T12:58:10Z")

</div>

I think that in activerecord-2.2.2\\lib\\active\_record\\validations.rb that specifying the attribute as “” have the nice benefit of just adding the specified message that was supplied. In activerecord-2.3.5\\lib\\active\_re…

---

## [Beginner](https://www.ruby-forum.com/t/beginner/182517)

<div class="topic-metadata">

**Author:** [@Chris\_Bautista](https://www.ruby-forum.com/u/Chris_Bautista)\
**Replies:** 2\
**Last updated:** [January 29, 2010, 12:29pm UTC](https://www.ruby-forum.com/t/beginner/182517 "2010-01-29T12:29:56Z")

</div>

Hello all! I was recommended by a buddy to check out Ruby on Rail. So here I am. Does anyone have any good websites for tutorials?

---

## [Mountable Apps](https://www.ruby-forum.com/t/mountable-apps/182530)

<div class="topic-metadata">

**Author:** [@Gary\_Taylor](https://www.ruby-forum.com/u/Gary_Taylor)\
**Replies:** 0\
**Last updated:** [January 29, 2010, 12:02pm UTC](https://www.ruby-forum.com/t/mountable-apps/182530 "2010-01-29T12:02:25Z")

</div>

Hi I am very interested in mountable applications in rails 3. I would like to know if this is an ‘engines’ replacement as I have a number of engines plugins and I need to know the way forward for converting them eit…

---

## [Date\_select](https://www.ruby-forum.com/t/date-select/182511)

<div class="topic-metadata">

**Author:** [@smit\_shah](https://www.ruby-forum.com/u/smit_shah)\
**Replies:** 3\
**Last updated:** [January 29, 2010, 11:26am UTC](https://www.ruby-forum.com/t/date-select/182511 "2010-01-29T11:26:01Z")

</div>

Hi all I am using rails 2.3.5. But I am facing the problem with date\_select tag. I have written code as follow. = date\_select :post, :birthdate, :start\_year =\> 1950, :end\_year =\> Date.today.year, :prompt =\> { :day =\> …

---

## [Errors.add adds "is invalid" if validation fails](https://www.ruby-forum.com/t/errors-add-adds-is-invalid-if-validation-fails/182523)

<div class="topic-metadata">

**Author:** [@karthikeyan](https://www.ruby-forum.com/u/karthikeyan)\
**Replies:** 2\
**Last updated:** [January 29, 2010, 11:06am UTC](https://www.ruby-forum.com/t/errors-add-adds-is-invalid-if-validation-fails/182523 "2010-01-29T11:06:14Z")

</div>

Rails, I have problem. I am validating fields of a class, if validation fails i use the method error.add “Say something” , but when I test my form by giving a invalid entry, I get error output as “Say something is inv…

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

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