# Rails

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

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

---

## [Is there a better way to do this?](https://www.ruby-forum.com/t/is-there-a-better-way-to-do-this/145768)

<div class="topic-metadata">

**Author:** [@max](https://www.ruby-forum.com/u/max)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 9:22pm UTC](https://www.ruby-forum.com/t/is-there-a-better-way-to-do-this/145768 "2008-08-13T21:22:01Z")

</div>

Im trying to update a ‘default’ field in a model to false, only rows that belong to a specific user the idea is to have only one default per user in that table… this is how im doing it def default @neighborhood = Us…

---

## [First try to make a controller test with RSpec on rails](https://www.ruby-forum.com/t/first-try-to-make-a-controller-test-with-rspec-on-rails/145780)

<div class="topic-metadata">

**Author:** [@Thib21](https://www.ruby-forum.com/u/Thib21)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 9:22pm UTC](https://www.ruby-forum.com/t/first-try-to-make-a-controller-test-with-rspec-on-rails/145780 "2008-08-13T21:22:00Z")

</div>

Hello, I’m trying to create a controller test with RSpec but I get the error when I run spec login\_controller\_spec.rb --format specdoc …/…/app/controllers/application.rb:4: uninitialized constant ActionController (…

---

## [Has\_many through - how to use middle model's info?](https://www.ruby-forum.com/t/has-many-through-how-to-use-middle-models-info/145776)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 9:12pm UTC](https://www.ruby-forum.com/t/has-many-through-how-to-use-middle-models-info/145776 "2008-08-13T21:12:01Z")

</div>

Hey, How can I use the information in the “middle” table of a :has\_many through relationship? Here’s an example: Club and Student have a :has\_many through relationship with each other. class Club \< ActiveRecord::Bas…

---

## [Prototype/Checkbox fun](https://www.ruby-forum.com/t/prototype-checkbox-fun/145774)

<div class="topic-metadata">

**Author:** [@jasonwold](https://www.ruby-forum.com/u/jasonwold)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/prototype-checkbox-fun/145774 "2008-08-13T21:03:49Z")

</div>

I’m probably missing the obvious clues, but i’m stumped. the script is not firing, so the div is still visible. this is the first time i’ve used a script since i’m still classified as a noob \<%= check\_box\_tag ‘accept…

---

## [Up-to-date OpenID Tutorial (For Rails 2.1)?](https://www.ruby-forum.com/t/up-to-date-openid-tutorial-for-rails-2-1/145729)

<div class="topic-metadata">

**Author:** [@ramontayag](https://www.ruby-forum.com/u/ramontayag)\
**Replies:** 5\
**Last updated:** [August 13, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/up-to-date-openid-tutorial-for-rails-2-1/145729 "2008-08-13T20:58:32Z")

</div>

Is there an up to date tutorial out there? I loved Ryan B.’ one but it doesn’t work with Rails 2.1 any, I believe. Thanks, Ramon T.

---

## [Seeking RoR developer from lat America](https://www.ruby-forum.com/t/seeking-ror-developer-from-lat-america/145772)

<div class="topic-metadata">

**Author:** [@decidestaffing](https://www.ruby-forum.com/u/decidestaffing)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 8:37pm UTC](https://www.ruby-forum.com/t/seeking-ror-developer-from-lat-america/145772 "2008-08-13T20:37:21Z")

</div>

1+ yrs Ruby on Rails programming experience. worked on commercial projects under direction and deadlines. STRONG knowledge of Ruby on Rails and how to structure new applications and databases. effective English communi…

---

## [FF params](https://www.ruby-forum.com/t/ff-params/145697)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 8:25pm UTC](https://www.ruby-forum.com/t/ff-params/145697 "2008-08-13T20:25:07Z")

</div>

View: \<%= text\_field\_tag :search\_id, "", :id=\>"search\_id" %\> \<%= link\_to\_remote “Search”, :url=\>{:controller=\>“search”, :action =\> “query”}, :with =\> "‘search\_id=’ + $(‘search\_id’).serialize() -%\> Controller: rend…

---

## [Newbie problem associating user with created objects](https://www.ruby-forum.com/t/newbie-problem-associating-user-with-created-objects/145769)

<div class="topic-metadata">

**Author:** [@Smerd](https://www.ruby-forum.com/u/Smerd)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 8:24pm UTC](https://www.ruby-forum.com/t/newbie-problem-associating-user-with-created-objects/145769 "2008-08-13T20:24:33Z")

</div>

I’m embarrassed that I can’t figure this out on my own. My only excuse is that I’m just a few weeks into rails… So, I’ve got restful\_authentication all up a running fine. I’ve got an “Idea” model, and all I want is fo…

---

## [How to prevent same migration timestamps when scripting?](https://www.ruby-forum.com/t/how-to-prevent-same-migration-timestamps-when-scripting/145756)

<div class="topic-metadata">

**Author:** [@DarkTatka](https://www.ruby-forum.com/u/DarkTatka)\
**Replies:** 4\
**Last updated:** [August 13, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/how-to-prevent-same-migration-timestamps-when-scripting/145756 "2008-08-13T19:28:51Z")

</div>

Hi, recently i had a need to generate lots of migrations and models from csv fixtures. I wrote a generator script. The problem is, it runs so “fast” that all migrations are of the same timestamp, so i cant migrate. #…

---

## [Connecting to multiple databases in rails](https://www.ruby-forum.com/t/connecting-to-multiple-databases-in-rails/145726)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 5\
**Last updated:** [August 13, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/connecting-to-multiple-databases-in-rails/145726 "2008-08-13T19:28:49Z")

</div>

Hi When strting my application I have three text boxes Username, password and company name A user on providing all these goes to user controller login\_process action…That means in my application database.yml have n…

---

## [Foreign key constraints on polymorphic relationships](https://www.ruby-forum.com/t/foreign-key-constraints-on-polymorphic-relationships/145757)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/foreign-key-constraints-on-polymorphic-relationships/145757 "2008-08-13T19:18:31Z")

</div>

I am setting up foreign key constraints in my database and wasn’t sure if it was possible to set them up on polymorphic relationships. Any help is greatly appreciated. Thanks.

---

## [Callback executed like after\_save but after transaction](https://www.ruby-forum.com/t/callback-executed-like-after-save-but-after-transaction/144301)

<div class="topic-metadata">

**Author:** [@jbjbjb](https://www.ruby-forum.com/u/jbjbjb)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 7:09pm UTC](https://www.ruby-forum.com/t/callback-executed-like-after-save-but-after-transaction/144301 "2008-08-13T19:09:30Z")

</div>

I’m trying to add some code for my ActiveRecord class so that it is executed whenever an object is updated, this code is a seperate process that reads from the same table represented by my model class so when it runs …

---

## [New to RoR - help with hosting application etc](https://www.ruby-forum.com/t/new-to-ror-help-with-hosting-application-etc/145476)

<div class="topic-metadata">

**Author:** [@erro](https://www.ruby-forum.com/u/erro)\
**Replies:** 6\
**Last updated:** [August 13, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/new-to-ror-help-with-hosting-application-etc/145476 "2008-08-13T19:07:44Z")

</div>

Hello, I’m new to the RoR and web development field. I’d like to buy/registrar a domain name and host the site on one of the hosting providers. However, since I’m new , I puzzled with the variety of types of servers …

---

## [Observe\_field on select in IE](https://www.ruby-forum.com/t/observe-field-on-select-in-ie/145751)

<div class="topic-metadata">

**Author:** [@scott](https://www.ruby-forum.com/u/scott)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 5:52pm UTC](https://www.ruby-forum.com/t/observe-field-on-select-in-ie/145751 "2008-08-13T17:52:06Z")

</div>

I’m using observe\_field on a ‘select’ and it works beautifully in FF and Safari. It doesn’t work at all in IE7. Here’s a snippet: \<%= f.select :project\_id, addresses\_array %\> \<%= observe\_field ‘listing\_project\_id’, …

---

## [Problem With Migrations](https://www.ruby-forum.com/t/problem-with-migrations/145715)

<div class="topic-metadata">

**Author:** [@pablo](https://www.ruby-forum.com/u/pablo)\
**Replies:** 3\
**Last updated:** [August 13, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/problem-with-migrations/145715 "2008-08-13T17:46:12Z")

</div>

Hi, I’m following an example of a Rails Book (Practical JRuby on Rails Projects, by Ola B.) and I’m stuck with a weird exception. I have these 3 migration files, but when I run them (with rake db:migrate) I see the fo…

---

## [Getting parameters from the request object](https://www.ruby-forum.com/t/getting-parameters-from-the-request-object/145596)

<div class="topic-metadata">

**Author:** [@fernando](https://www.ruby-forum.com/u/fernando)\
**Replies:** 4\
**Last updated:** [August 13, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/getting-parameters-from-the-request-object/145596 "2008-08-13T17:00:26Z")

</div>

Hi guy’s, I am having trouble getting parameters back from a POST request. I am using GWT on the front end so I do not have any params\[:name\]. request.raw\_post returns: name=hello&date=12&month=07&year=2008&administ…

---

## [Getting unexpected string value for NULL values](https://www.ruby-forum.com/t/getting-unexpected-string-value-for-null-values/145746)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/getting-unexpected-string-value-for-null-values/145746 "2008-08-13T16:46:57Z")

</div>

Upgrading a legacy app from 1.x to 2.1… The app has a Product model, and the Products migration contains: t.column :serial\_no, :string, :default =\> :null But if I create new, empty Product object like this in script…

---

## [New Rails and Ruby doc site: references2.com](https://www.ruby-forum.com/t/new-rails-and-ruby-doc-site-references2-com/145728)

<div class="topic-metadata">

**Author:** [@The\_Q](https://www.ruby-forum.com/u/The_Q)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/new-rails-and-ruby-doc-site-references2-com/145728 "2008-08-13T16:32:16Z")

</div>

I feel browing through API is just painfully slow, so I just put on a new site (done totally in ROR and jQuery) that supports quick search of Ruby, Rails API http://www.references2.com Hopefully it will be helpful t…

---

## [Difference between find\_by\_sql and Ruby find?](https://www.ruby-forum.com/t/difference-between-find-by-sql-and-ruby-find/145710)

<div class="topic-metadata">

**Author:** [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Replies:** 4\
**Last updated:** [August 13, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/difference-between-find-by-sql-and-ruby-find/145710 "2008-08-13T16:31:05Z")

</div>

Hi, What is the difference between find\_by\_sql and ruby find method? Where I use find\_by\_sql ? and Where I use find query? Is there any performance related difference between them? If yes then, which is feasible to u…

---

## [Attr\_accessor problems](https://www.ruby-forum.com/t/attr-accessor-problems/145740)

<div class="topic-metadata">

**Author:** [@jrm](https://www.ruby-forum.com/u/jrm)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/attr-accessor-problems/145740 "2008-08-13T16:14:01Z")

</div>

Hi, I have a model (Person) with an attr\_accessor defined variable (copy\_employer\_address) which is used as a field in a form (checkbox/ boolean). When the form is submitted the value of the field is there in params …

---

## [backgroundRB problem (newbie)](https://www.ruby-forum.com/t/backgroundrb-problem-newbie/145732)

<div class="topic-metadata">

**Author:** [@Iain\_A](https://www.ruby-forum.com/u/Iain_A)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/backgroundrb-problem-newbie/145732 "2008-08-13T16:08:10Z")

</div>

Hello, I am trying to upload and process very large CSV files. For this I am trying to use backgroundRB. The problem is that I cannot access a variable inside my worker until the methods have finished even though I a…

---

## [Error submitting form](https://www.ruby-forum.com/t/error-submitting-form/145725)

<div class="topic-metadata">

**Author:** [@verifier](https://www.ruby-forum.com/u/verifier)\
**Replies:** 5\
**Last updated:** [August 13, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/error-submitting-form/145725 "2008-08-13T15:41:43Z")

</div>

Hi I just started learning ruby on rails. Now i’ve made a simple form with a textfield and a submit button. ------------------------------------------------------- When i submit my form i have an error call…

---

## [Calling a ruby script from javascript](https://www.ruby-forum.com/t/calling-a-ruby-script-from-javascript/145742)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 3\
**Last updated:** [August 13, 2008, 3:29pm UTC](https://www.ruby-forum.com/t/calling-a-ruby-script-from-javascript/145742 "2008-08-13T15:29:25Z")

</div>

Here’s the situation: I need to call in an RSS feed to display on a page, and am using the jfeed plugin for jquery to parse the feed and display it, however, it will only parse a local feed, so in order to parse a rem…

---

## [@attributes\_cache in AR model set to nil?](https://www.ruby-forum.com/t/attributes-cache-in-ar-model-set-to-nil/145741)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/attributes-cache-in-ar-model-set-to-nil/145741 "2008-08-13T15:18:52Z")

</div>

Hi, did anyone ever ran into the problem that @attributes\_cache being set to nil somehow? That problems occurs running “rake spec” but not running the single spec. The error occurs e.g. here: Thanx a lot, Tobi

---

## [Google\_analytics gem problems](https://www.ruby-forum.com/t/google-analytics-gem-problems/145691)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 6\
**Last updated:** [August 13, 2008, 2:20pm UTC](https://www.ruby-forum.com/t/google-analytics-gem-problems/145691 "2008-08-13T14:20:09Z")

</div>

I’ve honestly never had any serious issues with a gem under RoR until now! I installed mark catley’s google analytics plugin (http://github.com/ markcatley/google\_analytics/tree/master) and it doesn’t seem to work at…

---

## [Disabling time stamps for a particular model](https://www.ruby-forum.com/t/disabling-time-stamps-for-a-particular-model/145733)

<div class="topic-metadata">

**Author:** [@Mukund](https://www.ruby-forum.com/u/Mukund)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 2:01pm UTC](https://www.ruby-forum.com/t/disabling-time-stamps-for-a-particular-model/145733 "2008-08-13T14:01:23Z")

</div>

Why can’t I do this on my Model class Abc \< ActiveRecordBase def before\_save ActiveRecord::Base.record\_timestamps = false end def after\_save ActiveRecord::Base.record\_timestamps = true end end ABC.save! throws e…

---

## [Rss auto subscription option - how to disable](https://www.ruby-forum.com/t/rss-auto-subscription-option-how-to-disable/145734)

<div class="topic-metadata">

**Author:** [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 1:43pm UTC](https://www.ruby-forum.com/t/rss-auto-subscription-option-how-to-disable/145734 "2008-08-13T13:43:49Z")

</div>

Hi all, I am not able to disbale RSS auto subscription option, anyone can give me ideas, my code as follows, xml.instruct! :xml, :version=\>“1.0” xml.rss(:version=\>“2.0”){ xml.channel{ xml.title(“RSS Feed Title”)… e…

---

## [Problems when using conditions in find Rails 2.1.0](https://www.ruby-forum.com/t/problems-when-using-conditions-in-find-rails-2-1-0/145681)

<div class="topic-metadata">

**Author:** [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 1:13pm UTC](https://www.ruby-forum.com/t/problems-when-using-conditions-in-find-rails-2-1-0/145681 "2008-08-13T13:13:24Z")

</div>

Never had this issue before updating to Rails 2.1.0. Now for some reason the condition clause used with an array is not working. I’ve been trying use work arounds but I can’t figure it out. Please anyone HELP!!! Query…

---

## [ActiveRecord::StatementInvalid error](https://www.ruby-forum.com/t/activerecord-statementinvalid-error/145597)

<div class="topic-metadata">

**Author:** [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Replies:** 6\
**Last updated:** [August 13, 2008, 1:03pm UTC](https://www.ruby-forum.com/t/activerecord-statementinvalid-error/145597 "2008-08-13T13:03:07Z")

</div>

I updated to Rails 2.1.0 and I’m getting an ActiveRecord::StatementInvalid error on an sql query that was working on the previous version. A simple call with and include getting data from 2 tables. I’m not sure why th…

---

## [Restoring original parameters along with URI](https://www.ruby-forum.com/t/restoring-original-parameters-along-with-uri/145730)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/restoring-original-parameters-along-with-uri/145730 "2008-08-13T12:50:10Z")

</div>

Hi, I redirect people to login page for those who have not logged in. I use :before\_filter to do this. I store the original Uri in session so that when he logs in I redirect to. But parameters are not getting store i…

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

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