# Rails

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

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

---

## [Help with debugging - undefined method \`\[\]' for nil:NilClass (NoMethodError)?](https://www.ruby-forum.com/t/help-with-debugging-undefined-method-for-nil-nilclass-nomethoderror/150150)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 2\
**Last updated:** [October 4, 2008, 9:31pm UTC](https://www.ruby-forum.com/t/help-with-debugging-undefined-method-for-nil-nilclass-nomethoderror/150150 "2008-10-04T21:31:57Z")

</div>

Hello all, Question for you all… I never came across this yet, I have an app where in developement it works perfect, but when I tried to launch it in production mode I received the following error below… How can I …

---

## [Controller instance variables](https://www.ruby-forum.com/t/controller-instance-variables/150144)

<div class="topic-metadata">

**Author:** [@mrpete](https://www.ruby-forum.com/u/mrpete)\
**Replies:** 4\
**Last updated:** [October 4, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/controller-instance-variables/150144 "2008-10-04T19:31:39Z")

</div>

hi, i’m very new to ruby and rails so be gentle. i am trying to set up a form that uses some validation but i’m having issues. i have a controller class that contains 2 methods: one for showing the form and another …

---

## [Nested resources deletion](https://www.ruby-forum.com/t/nested-resources-deletion/150139)

<div class="topic-metadata">

**Author:** [@roa](https://www.ruby-forum.com/u/roa)\
**Replies:** 2\
**Last updated:** [October 4, 2008, 6:26pm UTC](https://www.ruby-forum.com/t/nested-resources-deletion/150139 "2008-10-04T18:26:26Z")

</div>

Hi, I managed to get the complex forms and nested resources described in #75 Complex Forms Part 3 - RailsCasts to work. But I’m having problems when deleting a sub item. def existing\_task\_attributes=(task\_attributes) …

---

## [What is the difference save() vs save!()](https://www.ruby-forum.com/t/what-is-the-difference-save-vs-save/150143)

<div class="topic-metadata">

**Author:** [@palani](https://www.ruby-forum.com/u/palani)\
**Replies:** 1\
**Last updated:** [October 4, 2008, 4:42pm UTC](https://www.ruby-forum.com/t/what-is-the-difference-save-vs-save/150143 "2008-10-04T16:42:56Z")

</div>

Hi, Can anyone please tell me the difference between save & save!() method

---

## [Problem with unpacked gems and Kernel#gem](https://www.ruby-forum.com/t/problem-with-unpacked-gems-and-kernel-gem/150062)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [October 4, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/problem-with-unpacked-gems-and-kernel-gem/150062 "2008-10-04T13:49:25Z")

</div>

Hi all, I have searched and searched for this, to no avail. Maybe someone here can give me a hand. In my environment.rb, I added “config.gem” lines for a few gems that my app requires. Then, I went ahead and called…

---

## [Strong Rails developer available for contracts --- Referral Incentive](https://www.ruby-forum.com/t/strong-rails-developer-available-for-contracts-referral-incentive/150128)

<div class="topic-metadata">

**Author:** [@GaryL](https://www.ruby-forum.com/u/GaryL)\
**Replies:** 0\
**Last updated:** [October 4, 2008, 3:16am UTC](https://www.ruby-forum.com/t/strong-rails-developer-available-for-contracts-referral-incentive/150128 "2008-10-04T03:16:56Z")

</div>

Hello Listers, Do you know of a Rails project that can use a super-strong, experienced Rails Developer? We have a great referral incentive program that pays $1,000 for a referral resulting in a long-term contract. …

---

## [Count number of lines in a file with file.open](https://www.ruby-forum.com/t/count-number-of-lines-in-a-file-with-file-open/150118)

<div class="topic-metadata">

**Author:** [@morgan](https://www.ruby-forum.com/u/morgan)\
**Replies:** 3\
**Last updated:** [October 4, 2008, 12:12am UTC](https://www.ruby-forum.com/t/count-number-of-lines-in-a-file-with-file-open/150118 "2008-10-04T00:12:24Z")

</div>

ok so i’m trying to just read out a file line by line and i can’t seem to figure out how to not get an EOFerror… is there some way to tell when i get to the end of the file? i’m just reading out line by line, splitti…

---

## [Using text\_field\_with\_auto\_complete with afterUpdateElement](https://www.ruby-forum.com/t/using-text-field-with-auto-complete-with-afterupdateelement/150119)

<div class="topic-metadata">

**Author:** [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 11:07pm UTC](https://www.ruby-forum.com/t/using-text-field-with-auto-complete-with-afterupdateelement/150119 "2008-10-03T23:07:28Z")

</div>

Hello everybody! I’m fairly new to RoR (Rails ver 1.2.6) but have managed to get the ‘text\_field\_with\_auto\_complete’ working alright in my application. Next step is to be able to synchronize 2 (or more) ‘text\_field\_w…

---

## [New to Rails](https://www.ruby-forum.com/t/new-to-rails/150005)

<div class="topic-metadata">

**Author:** [@Zack\_K](https://www.ruby-forum.com/u/Zack_K)\
**Replies:** 9\
**Last updated:** [October 3, 2008, 11:06pm UTC](https://www.ruby-forum.com/t/new-to-rails/150005 "2008-10-03T23:06:58Z")

</div>

Can someone help me get started, i’ve been messing around with it lately, and i also learn some Ruby to understand RoR somemore. I’ve been trying to get it too work for awhile, but my problem is that i can NEVER get m…

---

## [Create a menu out from database entries](https://www.ruby-forum.com/t/create-a-menu-out-from-database-entries/149707)

<div class="topic-metadata">

**Author:** [@dlc](https://www.ruby-forum.com/u/dlc)\
**Replies:** 3\
**Last updated:** [October 3, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/create-a-menu-out-from-database-entries/149707 "2008-10-03T22:22:27Z")

</div>

Hi I am starting to work with rails and like to build a very basic cms. I was using scaffolding. Page title:string permalink:string body:text. What I like to do is create a menu out of the database entries permalink…

---

## [Active record losing connection, in non-Rails script](https://www.ruby-forum.com/t/active-record-losing-connection-in-non-rails-script/150096)

<div class="topic-metadata">

**Author:** [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Replies:** 2\
**Last updated:** [October 3, 2008, 10:09pm UTC](https://www.ruby-forum.com/t/active-record-losing-connection-in-non-rails-script/150096 "2008-10-03T22:09:57Z")

</div>

This isn’t a Rails program, but since ActiveRecord is a part of Rails I thought it would be fitting to post here. Anyway, sorry if anyone is bothered by that. My problem is that I occasionally get this error: “Mysql:…

---

## [Why doesn't named\_scope sort properly?](https://www.ruby-forum.com/t/why-doesnt-named-scope-sort-properly/149966)

<div class="topic-metadata">

**Author:** [@mattclarkson](https://www.ruby-forum.com/u/mattclarkson)\
**Replies:** 2\
**Last updated:** [October 3, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/why-doesnt-named-scope-sort-properly/149966 "2008-10-03T21:51:08Z")

</div>

I have this simple named\_scope that returns all Events after a given id: named\_scope :recent\_by\_id, lambda {|id| { :conditions =\> \[‘id \> ?’, id\], :order =\> ‘id ASC’ }} The problem is that named\_scope returns a query…

---

## [Adding an action to a ressource](https://www.ruby-forum.com/t/adding-an-action-to-a-ressource/150019)

<div class="topic-metadata">

**Author:** [@pandabeer](https://www.ruby-forum.com/u/pandabeer)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/adding-an-action-to-a-ressource/150019 "2008-10-03T21:46:22Z")

</div>

Hello everybody, I would like to use a pretty path like new\_article in order to route easily on a specific ressource. In my case, I had added this new action in my articles controller: def lock #… end And now I wo…

---

## [Best practice for common functional tests?](https://www.ruby-forum.com/t/best-practice-for-common-functional-tests/150111)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 0\
**Last updated:** [October 3, 2008, 9:15pm UTC](https://www.ruby-forum.com/t/best-practice-for-common-functional-tests/150111 "2008-10-03T21:15:46Z")

</div>

All, I’m working on an ActiveScaffold based application, and in the interest of getting more functional test coverage, I’d like to verify things about AS-generated screens in the context of multiple controllers. In o…

---

## [Problems running an older (1.1.6) rails app under 2.0.2](https://www.ruby-forum.com/t/problems-running-an-older-1-1-6-rails-app-under-2-0-2/150107)

<div class="topic-metadata">

**Author:** [@kyle](https://www.ruby-forum.com/u/kyle)\
**Replies:** 0\
**Last updated:** [October 3, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/problems-running-an-older-1-1-6-rails-app-under-2-0-2/150107 "2008-10-03T20:57:11Z")

</div>

I’ve been trying to get my old rails app (environment.rb tells me it was 1.1.6) working under 2.0.2 and I’ve been having a hell of a time. Trying to start up webrick nets me this: kyle@sublime-porte:~/code/Ruby/midnet…

---

## [Removing Non Alpha & Numeric Characters From String](https://www.ruby-forum.com/t/removing-non-alpha-numeric-characters-from-string/150041)

<div class="topic-metadata">

**Author:** [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Replies:** 6\
**Last updated:** [October 3, 2008, 8:33pm UTC](https://www.ruby-forum.com/t/removing-non-alpha-numeric-characters-from-string/150041 "2008-10-03T20:33:17Z")

</div>

Hello. We have book titles as a column in our database, which I would like to use in our URLS for SEO purposes. Given that these are titles, they include characters other than alphabets and numbers (e.g. punctuation, …

---

## [Confusion about HTTP header content during functional tests](https://www.ruby-forum.com/t/confusion-about-http-header-content-during-functional-tests/150092)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 4\
**Last updated:** [October 3, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/confusion-about-http-header-content-during-functional-tests/150092 "2008-10-03T20:04:14Z")

</div>

I’m seeing some header output from various HTTP requests and responses that doesn’t make sense to me. I have a couple of functional tests that appear to work ok. In the course of writing them, I went ahead and create…

---

## [Filter chain halted as \[:check\_authentication\] rendered\_or\_r](https://www.ruby-forum.com/t/filter-chain-halted-as-check-authentication-rendered-or-r/150089)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/filter-chain-halted-as-check-authentication-rendered-or-r/150089 "2008-10-03T19:42:38Z")

</div>

I have this page that you login in from. You get authenticated and then bumped over to the appropriate page depending on what your role is: Traveler, Travel Manager, Admin. All pieced work except for the role asssocia…

---

## [Transaction Result?](https://www.ruby-forum.com/t/transaction-result/150099)

<div class="topic-metadata">

**Author:** [@jsamildanach](https://www.ruby-forum.com/u/jsamildanach)\
**Replies:** 0\
**Last updated:** [October 3, 2008, 7:04pm UTC](https://www.ruby-forum.com/t/transaction-result/150099 "2008-10-03T19:04:44Z")

</div>

If I do a transaction block. How do I know if it passed or failed? I dont want to have to keep saying @saved = true if(something) then at the end find out if @saved is true

---

## [Ruby on Rails on shared host](https://www.ruby-forum.com/t/ruby-on-rails-on-shared-host/149921)

<div class="topic-metadata">

**Author:** [@tkbeili](https://www.ruby-forum.com/u/tkbeili)\
**Replies:** 6\
**Last updated:** [October 3, 2008, 6:37pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-shared-host/149921 "2008-10-03T18:37:18Z")

</div>

Hello, I built a web app using Ruby on Rails and it’s working perfectly on local host but once I move it to production I get this error message: Application error Rails application failed to start properly I tried t…

---

## [Migration](https://www.ruby-forum.com/t/migration/150095)

<div class="topic-metadata">

**Author:** [@ajitonrails](https://www.ruby-forum.com/u/ajitonrails)\
**Replies:** 0\
**Last updated:** [October 3, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/migration/150095 "2008-10-03T17:46:50Z")

</div>

hello All I am trying to create a table using rails migrations. after creating the table i want to move data from one table to newly created table. everything seems to be working fine… only issue is speed of moving d…

---

## [AJAX not Working in Production](https://www.ruby-forum.com/t/ajax-not-working-in-production/150054)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/ajax-not-working-in-production/150054 "2008-10-03T16:30:25Z")

</div>

I’m having an issue in my Prod environment where some sets of Ajax code are not working correctly Going to HugeDomains.com and clicking Add a Step executes the following code: \<%= link\_to\_function "Add a Step" do |pa…

---

## [Has\_many association. Is this possible?](https://www.ruby-forum.com/t/has-many-association-is-this-possible/150068)

<div class="topic-metadata">

**Author:** [@TheZ](https://www.ruby-forum.com/u/TheZ)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 3:13pm UTC](https://www.ruby-forum.com/t/has-many-association-is-this-possible/150068 "2008-10-03T15:13:58Z")

</div>

I have the following schema. table: user t.column :id, :integer table: friends t.column :user\_id, :integer #Owner of this friendship t.column :friend\_id, :integer #FK to User table table: activity t.column :us…

---

## [Javascript/Prototype helper and redirect\_to](https://www.ruby-forum.com/t/javascript-prototype-helper-and-redirect-to/150079)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 3\
**Last updated:** [October 3, 2008, 10:47am UTC](https://www.ruby-forum.com/t/javascript-prototype-helper-and-redirect-to/150079 "2008-10-03T10:47:35Z")

</div>

Is there a Javascript/Prototype helper with which you can use redirect\_to? Ive been searching all around and can’t seem to find any information about this. I need to use an ajax helper to send data from a javascript…

---

## [Ajax live valiation on username](https://www.ruby-forum.com/t/ajax-live-valiation-on-username/149594)

<div class="topic-metadata">

**Author:** [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 10:18am UTC](https://www.ruby-forum.com/t/ajax-live-valiation-on-username/149594 "2008-10-03T10:18:01Z")

</div>

This has probably been definitively answered elsewhere (it applies to the default setup for restful\_authentication), but I haven’t been able to track the solution down. My User model has a unique ‘username’ (or :login…

---

## [Rails looking for development db in production](https://www.ruby-forum.com/t/rails-looking-for-development-db-in-production/150025)

<div class="topic-metadata">

**Author:** [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Replies:** 4\
**Last updated:** [October 3, 2008, 10:04am UTC](https://www.ruby-forum.com/t/rails-looking-for-development-db-in-production/150025 "2008-10-03T10:04:50Z")

</div>

Hi there everyone, On my production server I start the mongrel server as follows: mongrel\_rails start -e production -a 127.0.0.1 -p 3001 -d However when going to the domain I get the following error: #42000Unknown da…

---

## [Easier way to pull associated records of has\_many associated](https://www.ruby-forum.com/t/easier-way-to-pull-associated-records-of-has-many-associated/150067)

<div class="topic-metadata">

**Author:** [@knodi](https://www.ruby-forum.com/u/knodi)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 9:06am UTC](https://www.ruby-forum.com/t/easier-way-to-pull-associated-records-of-has-many-associated/150067 "2008-10-03T09:06:13Z")

</div>

Currently my User model has has\_many groups and the Group model has\_many folders. so is there any way to pulling all the folders like this. user.groups.folders? Currently I have to loop like this and dump them in to …

---

## [Fragment caching with search box](https://www.ruby-forum.com/t/fragment-caching-with-search-box/150064)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 0\
**Last updated:** [October 3, 2008, 3:04am UTC](https://www.ruby-forum.com/t/fragment-caching-with-search-box/150064 "2008-10-03T03:04:05Z")

</div>

I’m trying to setup some fragment caching which works fine for the index but i’m not sure how to ignore the caching if they are searching the index results. my code in short: ItemsController def index @items = Item…

---

## [\[Question\] How to show models attributes' value in validation message?](https://www.ruby-forum.com/t/question-how-to-show-models-attributes-value-in-validation-message/149994)

<div class="topic-metadata">

**Author:** [@boblu](https://www.ruby-forum.com/u/boblu)\
**Replies:** 2\
**Last updated:** [October 3, 2008, 1:52am UTC](https://www.ruby-forum.com/t/question-how-to-show-models-attributes-value-in-validation-message/149994 "2008-10-03T01:52:14Z")

</div>

Say I have a model with a validation in User model like this: Class User \< ActiveRecord::Base validates\_uniqueness\_of :name, :message=\>“user has already exist!” end As you can see, I want to write my own error messa…

---

## [Gruff bar charts and zero data](https://www.ruby-forum.com/t/gruff-bar-charts-and-zero-data/150061)

<div class="topic-metadata">

**Author:** [@mickey](https://www.ruby-forum.com/u/mickey)\
**Replies:** 0\
**Last updated:** [October 3, 2008, 12:43am UTC](https://www.ruby-forum.com/t/gruff-bar-charts-and-zero-data/150061 "2008-10-03T00:43:01Z")

</div>

Hi - I am creating bar and stacked bar charts in Gruff, but the problem I am having is that zero data is showing up as a thin bar. (It also seems to be that way in examples I have seen online where a zero value still …

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

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