# Rails

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

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

---

## [When to set a class attribute variable during boot](https://www.ruby-forum.com/t/when-to-set-a-class-attribute-variable-during-boot/156619)

<div class="topic-metadata">

**Author:** [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Replies:** 1\
**Last updated:** [December 31, 2008, 2:02am UTC](https://www.ruby-forum.com/t/when-to-set-a-class-attribute-variable-during-boot/156619 "2008-12-31T02:02:33Z")

</div>

I have an ActiveRecord model with a cattr\_accessor. The class attribute is set up like this: class MyModel \< ActiveRecord::Base cattr\_accessor :my\_attribute end Because I need to give #my\_attribute environment-speci…

---

## [Layout with yield usage?](https://www.ruby-forum.com/t/layout-with-yield-usage/156615)

<div class="topic-metadata">

**Author:** [@net](https://www.ruby-forum.com/u/net)\
**Replies:** 1\
**Last updated:** [December 31, 2008, 1:10am UTC](https://www.ruby-forum.com/t/layout-with-yield-usage/156615 "2008-12-31T01:10:25Z")

</div>

Hi! Im having this weird problem when the yield gets overwritten with the last yield used… My application layout looks like this: \<div id="left\_sidebar"\> \<%= render :partial =\> "shared/navigation" %\> \</…

---

## [Problem with associations that could be null sometimes](https://www.ruby-forum.com/t/problem-with-associations-that-could-be-null-sometimes/156581)

<div class="topic-metadata">

**Author:** [@cassiozen](https://www.ruby-forum.com/u/cassiozen)\
**Replies:** 1\
**Last updated:** [December 31, 2008, 1:08am UTC](https://www.ruby-forum.com/t/problem-with-associations-that-could-be-null-sometimes/156581 "2008-12-31T01:08:40Z")

</div>

Hi Everybody, I’m developing a little task management system with a Task model that belongs to Users and Projects. The problem is that sometimes a task won’t belongs to an user AND a project. It will be possible to a…

---

## [Arguments Error](https://www.ruby-forum.com/t/arguments-error/156603)

<div class="topic-metadata">

**Author:** [@ryanoverton](https://www.ruby-forum.com/u/ryanoverton)\
**Replies:** 10\
**Last updated:** [December 31, 2008, 12:27am UTC](https://www.ruby-forum.com/t/arguments-error/156603 "2008-12-31T00:27:49Z")

</div>

I’m new to rails so I apologize for my ignorance in advance… I’m working through a tutorial here but I think it may be written for a slightly older version of rails. Trying to make a store app. I’m getting the followi…

---

## [Wrong number of arguments?](https://www.ruby-forum.com/t/wrong-number-of-arguments/156572)

<div class="topic-metadata">

**Author:** [@ryanoverton](https://www.ruby-forum.com/u/ryanoverton)\
**Replies:** 10\
**Last updated:** [December 30, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/wrong-number-of-arguments/156572 "2008-12-30T20:05:26Z")

</div>

I’m going through a tutorial here and running into an error I’m not sure how to fix…this is my first foire into sessions. Trying to create a shopping cart for a store app. I’m getting this error: wrong number of argu…

---

## [Code refactoring is the key](https://www.ruby-forum.com/t/code-refactoring-is-the-key/156595)

<div class="topic-metadata">

**Author:** [@vlain](https://www.ruby-forum.com/u/vlain)\
**Replies:** 3\
**Last updated:** [December 30, 2008, 7:13pm UTC](https://www.ruby-forum.com/t/code-refactoring-is-the-key/156595 "2008-12-30T19:13:05Z")

</div>

After six month of development and a first release we decide to refactor our application. Since it was my first Ruby/Rails application there are a lot of horrible things inside it. And now? Some general hints? I star…

---

## [Opera web browser ActionController::InvalidAuthenticityToken](https://www.ruby-forum.com/t/opera-web-browser-actioncontroller-invalidauthenticitytoken/156601)

<div class="topic-metadata">

**Author:** [@slawek\_tuleja](https://www.ruby-forum.com/u/slawek_tuleja)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 7:04pm UTC](https://www.ruby-forum.com/t/opera-web-browser-actioncontroller-invalidauthenticitytoken/156601 "2008-12-30T19:04:21Z")

</div>

Hi! Problem with Opera web browser and protect\_from\_forgery. Under Opera I have exception: ActionController::InvalidAuthenticityToken, under Firefox, Chrome, IE - protect\_from\_forgery works fine. I googled internet …

---

## [Finding Child Records Efficiently](https://www.ruby-forum.com/t/finding-child-records-efficiently/156481)

<div class="topic-metadata">

**Author:** [@daz](https://www.ruby-forum.com/u/daz)\
**Replies:** 10\
**Last updated:** [December 30, 2008, 6:21pm UTC](https://www.ruby-forum.com/t/finding-child-records-efficiently/156481 "2008-12-30T18:21:58Z")

</div>

I have a family-tree structure to a person model. I want to be able to find people by specifying an array that corresponds to the family tree. So if Abe is grandpa, homer is dad and bart is the son, bart’s array would…

---

## [Problem logging out from RESTful authentication](https://www.ruby-forum.com/t/problem-logging-out-from-restful-authentication/156596)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 5:44pm UTC](https://www.ruby-forum.com/t/problem-logging-out-from-restful-authentication/156596 "2008-12-30T17:44:54Z")

</div>

I just plugged RESTful authentication into my application (following the outline given in Ryan Bate’s railscast). As I was doing so, I was reading through the code. (I know, what a concept! :-)) I noticed that the …

---

## [Rails/info/properties](https://www.ruby-forum.com/t/rails-info-properties/156592)

<div class="topic-metadata">

**Author:** [@nike](https://www.ruby-forum.com/u/nike)\
**Replies:** 1\
**Last updated:** [December 30, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/rails-info-properties/156592 "2008-12-30T15:58:02Z")

</div>

hi i had a doubt while creating a new rails project we are getting the basic welcome message as Welcome aboard Youâ€™re riding Ruby on Rails! About your applicationâ€™s environment on clicking the about ur applicati…

---

## [Who can consult with me on scaling and architecture?](https://www.ruby-forum.com/t/who-can-consult-with-me-on-scaling-and-architecture/156570)

<div class="topic-metadata">

**Author:** [@newbee-robert](https://www.ruby-forum.com/u/newbee-robert)\
**Replies:** 3\
**Last updated:** [December 30, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/who-can-consult-with-me-on-scaling-and-architecture/156570 "2008-12-30T15:46:53Z")

</div>

I’d love to pay someone who has serious scaling experience to talk with me about how to plan for scaling. I’m developing a network of applications in Rails that could see tens of millions of users. I’m in way over my …

---

## [Rails requires RubyGems \>= 1.1.1 : problem](https://www.ruby-forum.com/t/rails-requires-rubygems-1-1-1-problem/152780)

<div class="topic-metadata">

**Author:** [@tbaustert](https://www.ruby-forum.com/u/tbaustert)\
**Replies:** 11\
**Last updated:** [December 30, 2008, 3:00pm UTC](https://www.ruby-forum.com/t/rails-requires-rubygems-1-1-1-problem/152780 "2008-12-30T15:00:35Z")

</div>

Hello, On my local machine (Mac OS X 10.5.5), I get the following error when I try to run script/server start : “Rails requires RubyGems \>= 1.1.1 (you have 1.0.1). Please gem update --system and try again.” The Rail…

---

## [Index =\> nil params jumbled \*sometimes\*](https://www.ruby-forum.com/t/index-nil-params-jumbled-sometimes/156526)

<div class="topic-metadata">

**Author:** [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Replies:** 11\
**Last updated:** [December 30, 2008, 3:00pm UTC](https://www.ruby-forum.com/t/index-nil-params-jumbled-sometimes/156526 "2008-12-30T15:00:00Z")

</div>

My app has a timesheet, which is a collection of many TimeCards, based on a Date. I have one user that can create new TimeCards just fine, except on three associated Jobs. Each time he saves he gets a 500 error. Look…

---

## [\[ANN\] Plugin: ColumnScope 1.0](https://www.ruby-forum.com/t/ann-plugin-columnscope-1-0/156589)

<div class="topic-metadata">

**Author:** [@Florian\_ASSSSmann](https://www.ruby-forum.com/u/Florian_ASSSSmann)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/ann-plugin-columnscope-1-0/156589 "2008-12-30T14:04:41Z")

</div>

ColumnScope Plugin version 1.0 released! http://github.com/boof/column\_scope/ ColumnScope lets you select specified values from your DB into a model or an array without doing :select =\> SQL\_FRAGMENT and map! {|r|r.fo…

---

## [Problem with routes after upgrading to Rails 2.2.2](https://www.ruby-forum.com/t/problem-with-routes-after-upgrading-to-rails-2-2-2/156585)

<div class="topic-metadata">

**Author:** [@ANSS](https://www.ruby-forum.com/u/ANSS)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 1:38pm UTC](https://www.ruby-forum.com/t/problem-with-routes-after-upgrading-to-rails-2-2-2/156585 "2008-12-30T13:38:20Z")

</div>

Hello, After I’ve upgraded my application to Rails 2.2.2 I get a Routing Error: ######################################### ActionController::RoutingError in Home#index Showing app/views/application/\_extjs\_mainmenu.ht…

---

## [Problem with routes after upgrading to Rails 2.2.2](https://www.ruby-forum.com/t/problem-with-routes-after-upgrading-to-rails-2-2-2/196868)

<div class="topic-metadata">

**Author:** [@ANSS](https://www.ruby-forum.com/u/ANSS)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 1:35pm UTC](https://www.ruby-forum.com/t/problem-with-routes-after-upgrading-to-rails-2-2-2/196868 "2008-12-30T13:35:24Z")

</div>

Hello, After I’ve upgraded my application to Rails 2.2.2 I get a Routing Error: ######################################### ActionController::RoutingError in Home#index Showing app/views/application/\_extjs\_mainmenu.ht…

---

## [Help with model association](https://www.ruby-forum.com/t/help-with-model-association/156546)

<div class="topic-metadata">

**Author:** [@Petr\_Ruzicka](https://www.ruby-forum.com/u/Petr_Ruzicka)\
**Replies:** 2\
**Last updated:** [December 30, 2008, 12:32pm UTC](https://www.ruby-forum.com/t/help-with-model-association/156546 "2008-12-30T12:32:06Z")

</div>

Hi, I’m very new to RoR so my question may be bit stupid. I’m trying to create application that could serve as training log. So I have “Trainee” who goes to a gym. What he/she does is a “Workout” (and there is a bunc…

---

## [Delete All action](https://www.ruby-forum.com/t/delete-all-action/156043)

<div class="topic-metadata">

**Author:** [@daz](https://www.ruby-forum.com/u/daz)\
**Replies:** 3\
**Last updated:** [December 30, 2008, 12:19pm UTC](https://www.ruby-forum.com/t/delete-all-action/156043 "2008-12-30T12:19:46Z")

</div>

Hi, What is the best way to delete all members of a model? For example I have a tasks model and want to put a link in that will delete all tasks at once. Something like, @tasks = Task.all @tasks.each { |task| task.d…

---

## [Equivalent ruby syntax for this query](https://www.ruby-forum.com/t/equivalent-ruby-syntax-for-this-query/156583)

<div class="topic-metadata">

**Author:** [@mjayakumar2k6](https://www.ruby-forum.com/u/mjayakumar2k6)\
**Replies:** 2\
**Last updated:** [December 30, 2008, 11:13am UTC](https://www.ruby-forum.com/t/equivalent-ruby-syntax-for-this-query/156583 "2008-12-30T11:13:31Z")

</div>

Book.find(:all, :conditions=\>\[“release\_date \>= ? and release\_date \< ? and book\_type=‘New’”,@date\[:from\],@date\[:to\]\], :group=\>“auther\_id”, :order=\>“count() desc", :select=\>"auther\_id,sum(case when auther\_type = ‘New’…

---

## [SOT: Ruby Question](https://www.ruby-forum.com/t/sot-ruby-question/196867)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 10:55am UTC](https://www.ruby-forum.com/t/sot-ruby-question/196867 "2008-12-30T10:55:21Z")

</div>

I have the following code. It works but it seems to me that there must be a clearer, more compact way. Is there a way in Ruby to pass a method name to a method? Something simpler than a block or lambda? TIA, Jef…

---

## [Starling and Workling problem](https://www.ruby-forum.com/t/starling-and-workling-problem/156113)

<div class="topic-metadata">

**Author:** [@marc](https://www.ruby-forum.com/u/marc)\
**Replies:** 1\
**Last updated:** [December 30, 2008, 10:53am UTC](https://www.ruby-forum.com/t/starling-and-workling-problem/156113 "2008-12-30T10:53:01Z")

</div>

Hi all I am trying to run a background task with Starling and Workling, following Ryan B.’ screencast. My problem is that whenever I execute my async\_method, nothing happens. No errors are generated, and the app cont…

---

## [SOT: Ruby Question](https://www.ruby-forum.com/t/sot-ruby-question/156582)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 10:53am UTC](https://www.ruby-forum.com/t/sot-ruby-question/156582 "2008-12-30T10:53:01Z")

</div>

I have the following code. It works but it seems to me that there must be a clearer, more compact way. Is there a way in Ruby to pass a method name to a method? Something simpler than a block or lambda? TIA, Jef…

---

## [Reseting form controls](https://www.ruby-forum.com/t/reseting-form-controls/156580)

<div class="topic-metadata">

**Author:** [@sa125](https://www.ruby-forum.com/u/sa125)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 10:39am UTC](https://www.ruby-forum.com/t/reseting-form-controls/156580 "2008-12-30T10:39:27Z")

</div>

How would I reset the controls on a form? I have a few text fields and selection lists, and I want them cleared (text fields) or restored to the top value (the :prompt in the select). I tried the code below with rende…

---

## [Rails app supplying image to a static page?](https://www.ruby-forum.com/t/rails-app-supplying-image-to-a-static-page/156574)

<div class="topic-metadata">

**Author:** [@mksys](https://www.ruby-forum.com/u/mksys)\
**Replies:** 2\
**Last updated:** [December 30, 2008, 9:52am UTC](https://www.ruby-forum.com/t/rails-app-supplying-image-to-a-static-page/156574 "2008-12-30T09:52:42Z")

</div>

Can anyone help point me in the right direction on doing the following? Say I have a Rails app that deals with photos at photo.website.com, and I also have a legacy site at www.website.com. What I would like to do is…

---

## [Joins, Joins, Joins! Or Not?](https://www.ruby-forum.com/t/joins-joins-joins-or-not/156571)

<div class="topic-metadata">

**Author:** [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Replies:** 1\
**Last updated:** [December 30, 2008, 9:32am UTC](https://www.ruby-forum.com/t/joins-joins-joins-or-not/156571 "2008-12-30T09:32:46Z")

</div>

Good morning, I have a quick joins-related question: I have a a list of followings (User following another user’s activity) which basically have these followed users’ ids under ‘followable\_id’. now what I want to do …

---

## [How could I let rails render wml by default with render/redirect\_to method in the controller](https://www.ruby-forum.com/t/how-could-i-let-rails-render-wml-by-default-with-render-redirect-to-method-in-the-controller/156577)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [December 30, 2008, 9:12am UTC](https://www.ruby-forum.com/t/how-could-i-let-rails-render-wml-by-default-with-render-redirect-to-method-in-the-controller/156577 "2008-12-30T09:12:53Z")

</div>

Hi all, I am using rails to create a wap site. I have using the following code in the rails to make it work: #environment.rb Mime::Type.register “text/vnd.wap.wml”, :wml #controller def index … # some unrelated co…

---

## [Changing row color on checkbox click](https://www.ruby-forum.com/t/changing-row-color-on-checkbox-click/156560)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 6\
**Last updated:** [December 30, 2008, 7:05am UTC](https://www.ruby-forum.com/t/changing-row-color-on-checkbox-click/156560 "2008-12-30T07:05:08Z")

</div>

say for example i had something simple like this in a view: \<%= check\_box\_tag(:task) %\> how would i add onclick to change the row color on a check and when the check is removed? maybe something like this? page\[task\]…

---

## [Avoiding ActiveRecord loading for efficiency with lots of rows](https://www.ruby-forum.com/t/avoiding-activerecord-loading-for-efficiency-with-lots-of-rows/156548)

<div class="topic-metadata">

**Author:** [@gregthegerg](https://www.ruby-forum.com/u/gregthegerg)\
**Replies:** 2\
**Last updated:** [December 30, 2008, 6:01am UTC](https://www.ruby-forum.com/t/avoiding-activerecord-loading-for-efficiency-with-lots-of-rows/156548 "2008-12-30T06:01:26Z")

</div>

Hello all, This is my first post to this group, so please let me know if there is any protocol I’m supposed to follow that I missed. Anyway, I’ve been developing a Rails application for handling the registration and …

---

## [AJAX select box dropdown update form](https://www.ruby-forum.com/t/ajax-select-box-dropdown-update-form/156557)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 1\
**Last updated:** [December 30, 2008, 2:41am UTC](https://www.ruby-forum.com/t/ajax-select-box-dropdown-update-form/156557 "2008-12-30T02:41:07Z")

</div>

I have the following form with 2 selectbox drop downs: SelectBox1 SelectBox2 WHen the user changes the selection in SelectBox1, I want SelectBox2 to be updated to contain a different set of options. I’m not sure exa…

---

## [Gem version issue prevent server starting](https://www.ruby-forum.com/t/gem-version-issue-prevent-server-starting/156549)

<div class="topic-metadata">

**Author:** [@codecarpenter](https://www.ruby-forum.com/u/codecarpenter)\
**Replies:** 2\
**Last updated:** [December 30, 2008, 1:44am UTC](https://www.ruby-forum.com/t/gem-version-issue-prevent-server-starting/156549 "2008-12-30T01:44:22Z")

</div>

Hi All, I backed up my rails project and then reinstall Windows due to OS crash. Then I install the latest Ruby, RubyGem, and Rails and copy back the rails project. But now I cannot start the server (ruby script/serv…

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

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