# Rails

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

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

---

## [Using global variable to access model from controller](https://www.ruby-forum.com/t/using-global-variable-to-access-model-from-controller/130074)

<div class="topic-metadata">

**Author:** [@lucasc](https://www.ruby-forum.com/u/lucasc)\
**Replies:** 5\
**Last updated:** [February 25, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/using-global-variable-to-access-model-from-controller/130074 "2008-02-25T21:14:24Z")

</div>

Don’t know if this is possible but I am trying to save myself a lot of repeat code. I have a global variable $school in my application helper which is used to keep track of which school i need to access. In my contro…

---

## [After\_initialize and after\_find](https://www.ruby-forum.com/t/after-initialize-and-after-find/127100)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [February 25, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/after-initialize-and-after-find/127100 "2008-02-25T21:03:41Z")

</div>

Hello, I need to do some initialization on instances that involve an associated model. This means that when I find an object, it immediately does another query to get its association. To cancel the double query, I m…

---

## [Reading a cookie that was set in the controller](https://www.ruby-forum.com/t/reading-a-cookie-that-was-set-in-the-controller/130148)

<div class="topic-metadata">

**Author:** [@donv](https://www.ruby-forum.com/u/donv)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 8:59pm UTC](https://www.ruby-forum.com/t/reading-a-cookie-that-was-set-in-the-controller/130148 "2008-02-25T20:59:34Z")

</div>

Hi all! How do I best read a cookie value that was just set in the controller? The “cookies” object only gives access to cookies present in the request, not those set in the response. response.cookies returns nil in …

---

## [Reading a cookie that was set in the controller](https://www.ruby-forum.com/t/reading-a-cookie-that-was-set-in-the-controller/186759)

<div class="topic-metadata">

**Author:** [@donv](https://www.ruby-forum.com/u/donv)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 8:59pm UTC](https://www.ruby-forum.com/t/reading-a-cookie-that-was-set-in-the-controller/186759 "2008-02-25T20:59:34Z")

</div>

Hi all! How do I best read a cookie value that was just set in the controller? The “cookies” object only gives access to cookies present in the request, not those set in the response. response.cookies returns nil in …

---

## [Button\_to\_function with image?](https://www.ruby-forum.com/t/button-to-function-with-image/104564)

<div class="topic-metadata">

**Author:** [@miked](https://www.ruby-forum.com/u/miked)\
**Replies:** 6\
**Last updated:** [February 25, 2008, 8:54pm UTC](https://www.ruby-forum.com/t/button-to-function-with-image/104564 "2008-02-25T20:54:51Z")

</div>

Hi: does button\_to\_function allow the use of an image? I tried it in place of the text with “image\_tag” and it doesn’t work. Maybe some form of button\_to? Any direction you can give would be great! Mike

---

## [Rederded partial in iframe is adopting its parent page's hea](https://www.ruby-forum.com/t/rederded-partial-in-iframe-is-adopting-its-parent-pages-hea/128008)

<div class="topic-metadata">

**Author:** [@isea](https://www.ruby-forum.com/u/isea)\
**Replies:** 2\
**Last updated:** [February 25, 2008, 8:53pm UTC](https://www.ruby-forum.com/t/rederded-partial-in-iframe-is-adopting-its-parent-pages-hea/128008 "2008-02-25T20:53:00Z")

</div>

Hello, I have an iframe in my page that for some reason is rendering all of the code from the parent page. Basically what I have going is the parent page with its wrapper and header and all that just getting repeated …

---

## [Performance analyzer from log file](https://www.ruby-forum.com/t/performance-analyzer-from-log-file/118629)

<div class="topic-metadata">

**Author:** [@helzer](https://www.ruby-forum.com/u/helzer)\
**Replies:** 4\
**Last updated:** [February 25, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/performance-analyzer-from-log-file/118629 "2008-02-25T20:47:03Z")

</div>

Hi, I’m looking for a tool that can go through the production / test log files and give me some statistics on performance. Nothing fancy, just the information on how much time is spent on different actions (render / …

---

## [NoMethodError: undefined method \`\<=\>' for :zip:Symbol](https://www.ruby-forum.com/t/nomethoderror-undefined-method-for-symbol/130146)

<div class="topic-metadata">

**Author:** [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 8:26pm UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-for-symbol/130146 "2008-02-25T20:26:56Z")

</div>

Long time programmer, but I just started learning RoR last week. I am going through some examples in the book “Ruby on Rails: Up and Running”. The example I am on had me add a table to the database that looks like so…

---

## [Is there a way to set a global variable in my deploy](https://www.ruby-forum.com/t/is-there-a-way-to-set-a-global-variable-in-my-deploy/130145)

<div class="topic-metadata">

**Author:** [@lucasc](https://www.ruby-forum.com/u/lucasc)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-set-a-global-variable-in-my-deploy/130145 "2008-02-25T20:19:32Z")

</div>

I am deploying an application to several sub domains and need to set a global variable in each sub domain so that I query the correct table based on the sub domain. Currently I am doing this in my layouts but this do…

---

## [Error from script\\generate with --svn option](https://www.ruby-forum.com/t/error-from-script-generate-with-svn-option/130144)

<div class="topic-metadata">

**Author:** [@pfb](https://www.ruby-forum.com/u/pfb)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/error-from-script-generate-with-svn-option/130144 "2008-02-25T20:17:25Z")

</div>

I have not been able to google a solution to this error, and I didn’t find anything about it in the group archives. Here is what happens: C:\\path to\\my project\>ruby script\\generate scaffold article title:string body:…

---

## [Validation Idiom](https://www.ruby-forum.com/t/validation-idiom/130054)

<div class="topic-metadata">

**Author:** [@corywilkerson](https://www.ruby-forum.com/u/corywilkerson)\
**Replies:** 2\
**Last updated:** [February 25, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/validation-idiom/130054 "2008-02-25T19:53:04Z")

</div>

All - is there a standard pattern for the following case? My domain is pretty unique so let me use an analogy to try and better convey the problem. Let’s assume that a “director” owns a “series” and that an “adminis…

---

## [Ajax trees and LiveTree note](https://www.ruby-forum.com/t/ajax-trees-and-livetree-note/130140)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/ajax-trees-and-livetree-note/130140 "2008-02-25T19:47:18Z")

</div>

Hi you all, I will have to work in an app where it would be interesting to have a tree view, and with ajax if possible. I used LiveTree plugin, but it is abandoned, so two things: the author asks in his web if anybo…

---

## [Ajax trees and LiveTree note](https://www.ruby-forum.com/t/ajax-trees-and-livetree-note/186753)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/ajax-trees-and-livetree-note/186753 "2008-02-25T19:47:18Z")

</div>

Hi you all, I will have to work in an app where it would be interesting to have a tree view, and with ajax if possible. I used LiveTree plugin, but it is abandoned, so two things: the author asks in his web if anybo…

---

## [Leopard anyone?](https://www.ruby-forum.com/t/leopard-anyone/130079)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 2\
**Last updated:** [February 25, 2008, 7:34pm UTC](https://www.ruby-forum.com/t/leopard-anyone/130079 "2008-02-25T19:34:47Z")

</div>

So, with all the noise about Rails on Leopard, has anyone actually deployed to a product Xserve using the built-in stuff? Most specifically, the built-in Apache? Googling produces next to zero hits on the topic. Just …

---

## [Storing different types of data in 1 model](https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/186732)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 2\
**Last updated:** [February 25, 2008, 7:30pm UTC](https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/186732 "2008-02-25T19:30:50Z")

</div>

Hi all, I’m creating a statistics system for events. When an event has passed, an admin can enter statistics for that passed event. Every user attending the event and the event itself have statistics. The problem is …

---

## [Agile web developement - Depot App first application](https://www.ruby-forum.com/t/agile-web-developement-depot-app-first-application/130138)

<div class="topic-metadata">

**Author:** [@Jens\_MoewesSGerma](https://www.ruby-forum.com/u/Jens_MoewesSGerma)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/agile-web-developement-depot-app-first-application/130138 "2008-02-25T19:26:29Z")

</div>

hi there, just wondering - i´m building my first app as described in “agile web development” chapter 6 (depot) and followed the instructions to the letter - i saw that the database my set up creates by default is not …

---

## [Cannot get partial with collections to work](https://www.ruby-forum.com/t/cannot-get-partial-with-collections-to-work/186747)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 3\
**Last updated:** [February 25, 2008, 7:01pm UTC](https://www.ruby-forum.com/t/cannot-get-partial-with-collections-to-work/186747 "2008-02-25T19:01:04Z")

</div>

Hi everyone- Just learning Rails, and I’m wondering if someone can help me out. I have a story controller: class StoriesController \< ApplicationController def index @stories = Story.find(:all) end end and an ind…

---

## [Cannot get partial with collections to work](https://www.ruby-forum.com/t/cannot-get-partial-with-collections-to-work/130136)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/cannot-get-partial-with-collections-to-work/130136 "2008-02-25T18:47:33Z")

</div>

Hi everyone- Just learning Rails, and I’m wondering if someone can help me out. I have a story controller: class StoriesController \< ApplicationController def index @stories = Story.find(:all) end end and an ind…

---

## [Rails based Point of Sale?](https://www.ruby-forum.com/t/rails-based-point-of-sale/130135)

<div class="topic-metadata">

**Author:** [@sfwalter](https://www.ruby-forum.com/u/sfwalter)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/rails-based-point-of-sale/130135 "2008-02-25T18:22:07Z")

</div>

Hello, The company I work for is a national franchisor of about 100 retail stores across Canada. We currently use proprietary, firmware based point of sale hardware that costs us thousands of dollars per store and s…

---

## [What does undefined method \`session=' for ActionController::Base:Class mean?](https://www.ruby-forum.com/t/what-does-undefined-method-session-for-actioncontroller-class-mean/186743)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [February 25, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/what-does-undefined-method-session-for-actioncontroller-class-mean/186743 "2008-02-25T18:15:41Z")

</div>

Hi, I’m trying to take a rails project built on gem version 1.2.6 and upgrade it to 2.0.2. So far, I haven’t changed anything except this line in the config/environment.rb file … RAILS\_GEM\_VERSION = ‘2.0.2’ unless d…

---

## [ActiveResource, how to add a param to every request?](https://www.ruby-forum.com/t/activeresource-how-to-add-a-param-to-every-request/130133)

<div class="topic-metadata">

**Author:** [@ss\_1982](https://www.ruby-forum.com/u/ss_1982)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 6:03pm UTC](https://www.ruby-forum.com/t/activeresource-how-to-add-a-param-to-every-request/130133 "2008-02-25T18:03:38Z")

</div>

Hi, I have just created a couple of ActiveResource classes that are being used to communicate with a rest api. In every request I am having to place an api key as an additional param e.g. @book = Book.find(params\[:i…

---

## [What does undefined method \`session=' for ActionController::Base:Class mean?](https://www.ruby-forum.com/t/what-does-undefined-method-session-for-actioncontroller-class-mean/130132)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/what-does-undefined-method-session-for-actioncontroller-class-mean/130132 "2008-02-25T17:30:50Z")

</div>

Hi, I’m trying to take a rails project built on gem version 1.2.6 and upgrade it to 2.0.2. So far, I haven’t changed anything except this line in the config/environment.rb file … RAILS\_GEM\_VERSION = ‘2.0.2’ unless d…

---

## [XML/RSS doesn't generate](https://www.ruby-forum.com/t/xml-rss-doesnt-generate/130106)

<div class="topic-metadata">

**Author:** [@fonziguy](https://www.ruby-forum.com/u/fonziguy)\
**Replies:** 1\
**Last updated:** [February 25, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/xml-rss-doesnt-generate/130106 "2008-02-25T17:24:20Z")

</div>

Hi guys, Any ideas why my XML doesn’t generate for an RSS feed? I have the following in rss.html.erb \[code=ruby\]xml.instruct! :xml, :version =\> “1.0” xml.rss :version =\> “2.0” do xml.channel do xml.title “” xml.li…

---

## [Custom Actions in Routes.rb](https://www.ruby-forum.com/t/custom-actions-in-routes-rb/130127)

<div class="topic-metadata">

**Author:** [@evan](https://www.ruby-forum.com/u/evan)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/custom-actions-in-routes-rb/130127 "2008-02-25T17:08:54Z")

</div>

Hi, on rails 2.0.2 i generate a controller with actions Index and New using: “script/generate controller Recipe Index New” I can now access the actions index/new through /recipe/index or / recipe/new. But if i create…

---

## [Multiple Databases - Archive and Current Databases Question](https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/186738)

<div class="topic-metadata">

**Author:** [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/186738 "2008-02-25T17:02:40Z")

</div>

I’ve got a few different databases - 2 that hold archive data and 1 that holds current working application data. The 2 archive databases hold tables for quality assurance and are extremely large datasets, but they are…

---

## [Multiple Databases - Archive and Current Databases Question](https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/130128)

<div class="topic-metadata">

**Author:** [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/130128 "2008-02-25T17:02:40Z")

</div>

I’ve got a few different databases - 2 that hold archive data and 1 that holds current working application data. The 2 archive databases hold tables for quality assurance and are extremely large datasets, but they are…

---

## [Problem upgrading to rails 2.0](https://www.ruby-forum.com/t/problem-upgrading-to-rails-2-0/130096)

<div class="topic-metadata">

**Author:** [@ANSS](https://www.ruby-forum.com/u/ANSS)\
**Replies:** 7\
**Last updated:** [February 25, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/problem-upgrading-to-rails-2-0/130096 "2008-02-25T17:02:25Z")

</div>

Hi, I have a problem upgrading to rails 2.0, my current installation of rails is version 1.2.4 installed through the official Ubuntu repository (apt-get install rails), I installed rails through: gem install rails –…

---

## [Storing different types of data in 1 model](https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/130122)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 0\
**Last updated:** [February 25, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/130122 "2008-02-25T16:13:24Z")

</div>

Hi all, I’m creating a statistics system for events. When an event has passed, an admin can enter statistics for that passed event. Every user attending the event and the event itself have statistics. The problem is …

---

## [Facebooker Problem](https://www.ruby-forum.com/t/facebooker-problem/130103)

<div class="topic-metadata">

**Author:** [@ahmad](https://www.ruby-forum.com/u/ahmad)\
**Replies:** 1\
**Last updated:** [February 25, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/facebooker-problem/130103 "2008-02-25T15:26:58Z")

</div>

Hi guys, I’m just getting started with facebooker. I got a nasty problem. Every request redirects to facebook for authentication because i have included ensure\_authenticated\_to\_facebook and oce the authentication is o…

---

## [Flash\[:error\] -- nothing happens](https://www.ruby-forum.com/t/flash-error-nothing-happens/130052)

<div class="topic-metadata">

**Author:** [@anti](https://www.ruby-forum.com/u/anti)\
**Replies:** 4\
**Last updated:** [February 25, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/flash-error-nothing-happens/130052 "2008-02-25T14:04:42Z")

</div>

in the case of invalid login, the method bellow does nothing at flash\[:error\], just goes directly to =\>welcome page. is something missing something? def process\_login if user = User.authenticate(params\[:user\]) sessi…

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

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