# Rails

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

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

---

## [Cannot get fixtures working (with has\_and\_belongs\_to\_many)](https://www.ruby-forum.com/t/cannot-get-fixtures-working-with-has-and-belongs-to-many/153904)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 4\
**Last updated:** [November 26, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/cannot-get-fixtures-working-with-has-and-belongs-to-many/153904 "2008-11-26T15:46:57Z")

</div>

Hello, I have the following scenario: class User; has\_and\_belongs\_to\_many :roles; end class Role; has\_and\_belongs\_to\_many :users; end #roles schema only has name (string) as attribute an additional table ‘roles\_user…

---

## [Where should I put "prerequisite logic"?](https://www.ruby-forum.com/t/where-should-i-put-prerequisite-logic/153657)

<div class="topic-metadata">

**Author:** [@rasmus](https://www.ruby-forum.com/u/rasmus)\
**Replies:** 2\
**Last updated:** [November 26, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/where-should-i-put-prerequisite-logic/153657 "2008-11-26T15:46:17Z")

</div>

Hi there, I have this model called InventoryItem. Every time an InventoryItem is created (through the CharactersController and the create\_item action) I need to update others tables and make lookups in other tables, t…

---

## [Trouble accessing ruby constants globally](https://www.ruby-forum.com/t/trouble-accessing-ruby-constants-globally/154169)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [November 26, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/trouble-accessing-ruby-constants-globally/154169 "2008-11-26T15:36:11Z")

</div>

I’m trying to declare a constant in one file and access it in another. It doesn’t seem to be working. Here’s my declaration (at the top of a file, remainder of file omitted for brevity): NUM\_SECTIONS\_TO\_PARSE = 7 cl…

---

## [Developing with Ruby 1.8.2](https://www.ruby-forum.com/t/developing-with-ruby-1-8-2/154092)

<div class="topic-metadata">

**Author:** [@Diego](https://www.ruby-forum.com/u/Diego)\
**Replies:** 4\
**Last updated:** [November 26, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/developing-with-ruby-1-8-2/154092 "2008-11-26T15:27:59Z")

</div>

Hi all, I have to develop a Ruby on Rails web application using Ruby 1.8.2. Could you inform me about what are the latest versions of Rails and RubyGems that should work with Ruby 1.8.2. I am also looking for some do…

---

## [Clearing form fields for a popup](https://www.ruby-forum.com/t/clearing-form-fields-for-a-popup/154171)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 1\
**Last updated:** [November 26, 2008, 3:13pm UTC](https://www.ruby-forum.com/t/clearing-form-fields-for-a-popup/154171 "2008-11-26T15:13:17Z")

</div>

I am using prototype to create modal popups for my login and register pages, but the fields are populating with the data from certain variables. For example, I have a show page that finds a user like so: @user = Use…

---

## [Model associations](https://www.ruby-forum.com/t/model-associations/154218)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/model-associations/154218 "2008-11-26T14:47:23Z")

</div>

I’ve got the folowing models associated with each other venture \<— component --\> attribute --\> service ‘–\>’ means ‘belongs to’ in case someone wonders :wink: The thing is i want to show in the ‘show’ action for the ve…

---

## [Update Ajax RJS problem link\_to\_function](https://www.ruby-forum.com/t/update-ajax-rjs-problem-link-to-function/154211)

<div class="topic-metadata">

**Author:** [@vlain](https://www.ruby-forum.com/u/vlain)\
**Replies:** 1\
**Last updated:** [November 26, 2008, 1:56pm UTC](https://www.ruby-forum.com/t/update-ajax-rjs-problem-link-to-function/154211 "2008-11-26T13:56:01Z")

</div>

Hello to all. I use ajax tabs (rails redux) http://actsasflinn.com/Ajax\_Tabs/index.html. I have 2 simple tab (“All” and “Favorites”). As default “All” is selected, when I click “Favorites” request is correct and ther…

---

## [Need help for Best Approach to Model](https://www.ruby-forum.com/t/need-help-for-best-approach-to-model/154208)

<div class="topic-metadata">

**Author:** [@srj](https://www.ruby-forum.com/u/srj)\
**Replies:** 1\
**Last updated:** [November 26, 2008, 1:46pm UTC](https://www.ruby-forum.com/t/need-help-for-best-approach-to-model/154208 "2008-11-26T13:46:03Z")

</div>

Hello - I am new to Rails (and Ruby), and would appreciate some guidance on the best way to model this situation: I am creating a game website, that will require users to register on the site before they can play the…

---

## [Updation of the object field values](https://www.ruby-forum.com/t/updation-of-the-object-field-values/154111)

<div class="topic-metadata">

**Author:** [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Replies:** 3\
**Last updated:** [November 26, 2008, 1:23pm UTC](https://www.ruby-forum.com/t/updation-of-the-object-field-values/154111 "2008-11-26T13:23:16Z")

</div>

Hi, I have a group object with “name, description etc” fields. I want to update that object’s description in such a way that it will not reflect in database. You can say I want to temporary update the value of that f…

---

## [Download problem!](https://www.ruby-forum.com/t/download-problem/154206)

<div class="topic-metadata">

**Author:** [@smartee](https://www.ruby-forum.com/u/smartee)\
**Replies:** 2\
**Last updated:** [November 26, 2008, 1:23pm UTC](https://www.ruby-forum.com/t/download-problem/154206 "2008-11-26T13:23:08Z")

</div>

friends, am using send\_file function controller def download @event = Event.find(:first, :conditions =\> \[‘id = ?’,params\[:id\]\]) #@path=@event.file @path=params\[:file\_path\] send\_file("#{@path}",:type =\> ‘all’) end …

---

## [Nested namespaces with nested resources](https://www.ruby-forum.com/t/nested-namespaces-with-nested-resources/154213)

<div class="topic-metadata">

**Author:** [@gzigzigzeo](https://www.ruby-forum.com/u/gzigzigzeo)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 12:56pm UTC](https://www.ruby-forum.com/t/nested-namespaces-with-nested-resources/154213 "2008-11-26T12:56:39Z")

</div>

Hello. I have a problem with url\_for resource. My models: class QuestionLibrary::Group \< ActiveRecord::Base class QuestionLibrary::Competence \< ActiveRecord::Base set\_table\_name “question\_library\_competences” belon…

---

## [Form Data To Session](https://www.ruby-forum.com/t/form-data-to-session/154210)

<div class="topic-metadata">

**Author:** [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 12:56pm UTC](https://www.ruby-forum.com/t/form-data-to-session/154210 "2008-11-26T12:56:39Z")

</div>

How do you collect form data and put it in to a session so that I can pass it to another form later on in the site? Thank you

---

## [Problem popup](https://www.ruby-forum.com/t/problem-popup/154200)

<div class="topic-metadata">

**Author:** [@maite](https://www.ruby-forum.com/u/maite)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 11:11am UTC](https://www.ruby-forum.com/t/problem-popup/154200 "2008-11-26T11:11:55Z")

</div>

hello list. I use popup in my project \<%= link\_to image\_tag("edit.png"), edit\_mercado\_path(mercado), :popup =\>\['subjects', 'width=500,height=500,toolbar=no,titlebar=no,status=no,left=500,top=300, scrollbars=yes'\]%\> I w…

---

## [Errors using restful-authentication + rubyist-aasm on 2.2.2](https://www.ruby-forum.com/t/errors-using-restful-authentication-rubyist-aasm-on-2-2-2/154198)

<div class="topic-metadata">

**Author:** [@marzapower](https://www.ruby-forum.com/u/marzapower)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 11:07am UTC](https://www.ruby-forum.com/t/errors-using-restful-authentication-rubyist-aasm-on-2-2-2/154198 "2008-11-26T11:07:04Z")

</div>

Hello, I’m asking for a problem which I cannot find a solution to. I’m using a freshly installed Debian machine, with lighttpd as web server, ruby 1.8.5, rubygems 1.3.1, rails 2.2.2. I’m using both the sqlite3-ruby g…

---

## [How to render part of code in another one](https://www.ruby-forum.com/t/how-to-render-part-of-code-in-another-one/153980)

<div class="topic-metadata">

**Author:** [@petan](https://www.ruby-forum.com/u/petan)\
**Replies:** 6\
**Last updated:** [November 26, 2008, 10:35am UTC](https://www.ruby-forum.com/t/how-to-render-part-of-code-in-another-one/153980 "2008-11-26T10:35:07Z")

</div>

Hi, I have a simple sideblog with my posts in it. I can see 5 last posts in my index action. Could I add form to submit a new post at the top of my posts? I dont know how to render new post action in my index action t…

---

## [Passing an array List of Object](https://www.ruby-forum.com/t/passing-an-array-list-of-object/153446)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [November 26, 2008, 10:28am UTC](https://www.ruby-forum.com/t/passing-an-array-list-of-object/153446 "2008-11-26T10:28:39Z")

</div>

Hi friends, I’m trying to pass an Array list of Objects that I have captured on the fly after querying a web service. I have the array list available with me. Now, the issue that I’m facing is that I would want to pas…

---

## [Absolute Beginner -- having much trouble getting started](https://www.ruby-forum.com/t/absolute-beginner-having-much-trouble-getting-started/154062)

<div class="topic-metadata">

**Author:** [@gpicton](https://www.ruby-forum.com/u/gpicton)\
**Replies:** 4\
**Last updated:** [November 26, 2008, 7:03am UTC](https://www.ruby-forum.com/t/absolute-beginner-having-much-trouble-getting-started/154062 "2008-11-26T07:03:34Z")

</div>

Hello I’ve been trying to get this working for a good amount of time and with how simple its supposed to be I am feeling slightly overwhelmed. I am using win XP sp3 and trying to get ruby and rails installed. And am…

---

## [NetBeans 6.5: RuntimeError when running tests](https://www.ruby-forum.com/t/netbeans-6-5-runtimeerror-when-running-tests/154139)

<div class="topic-metadata">

**Author:** [@George](https://www.ruby-forum.com/u/George)\
**Replies:** 1\
**Last updated:** [November 26, 2008, 6:06am UTC](https://www.ruby-forum.com/t/netbeans-6-5-runtimeerror-when-running-tests/154139 "2008-11-26T06:06:51Z")

</div>

Is anyone on the list having success using NetBeans 6.5? I’ve been having difficulty running my tests on NetBeans 6.5. Whenever I attempt to run the tests on my project, I get numerous errors such as this one: Runtim…

---

## [Running callbacks in observers before callbacks in models](https://www.ruby-forum.com/t/running-callbacks-in-observers-before-callbacks-in-models/154179)

<div class="topic-metadata">

**Author:** [@brendon](https://www.ruby-forum.com/u/brendon)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 5:46am UTC](https://www.ruby-forum.com/t/running-callbacks-in-observers-before-callbacks-in-models/154179 "2008-11-26T05:46:24Z")

</div>

Hi there, I’ve noticed a switch in behaviour between Rails 2.2.2 and older versions. I have a polymorphic tree structure in my CMS. So when a person creates a Page, I have an observer watching the Page model, after a …

---

## [Point Me to Mocha 0.9.3](https://www.ruby-forum.com/t/point-me-to-mocha-0-9-3/154145)

<div class="topic-metadata">

**Author:** [@josephholsten](https://www.ruby-forum.com/u/josephholsten)\
**Replies:** 3\
**Last updated:** [November 26, 2008, 1:42am UTC](https://www.ruby-forum.com/t/point-me-to-mocha-0-9-3/154145 "2008-11-26T01:42:34Z")

</div>

I can’t seem to find a copy of Mocha 0.9.3, gem or otherwise. A recent patch to ActiveSupport requires Mocha 0.9.3 support.\[1\] The Mocha home page advertises 0.9.2.\[2\] The current tree at github\[3\] builds into 0.9.2.\[…

---

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

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [November 26, 2008, 1:41am UTC](https://www.ruby-forum.com/t/script-dbconsole/154165 "2008-11-26T01:41:59Z")

</div>

I’m running rails 2.2.2. Is script/dbconsole part of this or do I have to somehow install it? When I run script/dbconsole I get: -bash: script/dbconsole: No such file or directory But running script/console I do get: …

---

## [About Browser detection](https://www.ruby-forum.com/t/about-browser-detection/154102)

<div class="topic-metadata">

**Author:** [@saurav](https://www.ruby-forum.com/u/saurav)\
**Replies:** 2\
**Last updated:** [November 26, 2008, 1:41am UTC](https://www.ruby-forum.com/t/about-browser-detection/154102 "2008-11-26T01:41:58Z")

</div>

Hi all , I am new for ROR . Is there any way to detect the browsers from rails application?? I having some issue of designing due to that, my tabs create gap, which is not there.??? Any Idea?

---

## [Retrieve resource name from request](https://www.ruby-forum.com/t/retrieve-resource-name-from-request/154162)

<div class="topic-metadata">

**Author:** [@Borja\_MartSSS\_n](https://www.ruby-forum.com/u/Borja_MartSSS_n)\
**Replies:** 0\
**Last updated:** [November 26, 2008, 12:21am UTC](https://www.ruby-forum.com/t/retrieve-resource-name-from-request/154162 "2008-11-26T00:21:15Z")

</div>

Hi, I was wondering if there is any way for retrieving the resource name from the request. Suppose I have the following resource definition in my routes.rb file: map.resources :pages, :controller =\> ‘documents’ now,…

---

## [Rails API is down](https://www.ruby-forum.com/t/rails-api-is-down/154156)

<div class="topic-metadata">

**Author:** [@gamafranco](https://www.ruby-forum.com/u/gamafranco)\
**Replies:** 3\
**Last updated:** [November 26, 2008, 12:07am UTC](https://www.ruby-forum.com/t/rails-api-is-down/154156 "2008-11-26T00:07:13Z")

</div>

Hi, http://api.rubyonrails.org/ is down. Regards, Tiago F.

---

## [Fragment cache hit is super slow every two times](https://www.ruby-forum.com/t/fragment-cache-hit-is-super-slow-every-two-times/154151)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [November 25, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/fragment-cache-hit-is-super-slow-every-two-times/154151 "2008-11-25T23:12:40Z")

</div>

Hi, I have a piece of html that I fragment cache. For a very strange reason every two times I request the page, rendering the fragment cache takes a lot of time. Example: I request index page, rendering takes 300ms …

---

## [Migration error, mysql, change column limit](https://www.ruby-forum.com/t/migration-error-mysql-change-column-limit/154150)

<div class="topic-metadata">

**Author:** [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Replies:** 1\
**Last updated:** [November 25, 2008, 10:45pm UTC](https://www.ruby-forum.com/t/migration-error-mysql-change-column-limit/154150 "2008-11-25T22:45:30Z")

</div>

Hmm, one of my migrations have stopped working on #down. It still works on #up. (It’s also possible that I never tested it for #down before, and it never worked, heh.) I can’t figure out why not. Pretty simple. class…

---

## [\[ANN\] acts\_as\_materialized\_tree](https://www.ruby-forum.com/t/ann-acts-as-materialized-tree/154152)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 0\
**Last updated:** [November 25, 2008, 10:31pm UTC](https://www.ruby-forum.com/t/ann-acts-as-materialized-tree/154152 "2008-11-25T22:31:10Z")

</div>

I have made an experimental implementation of materialized trees for ActiveRecord. In a materialized tree, each node contains an explicit path attribute. This allows for efficient subtree searches \[expensive in acts\_a…

---

## [User without ALTER/DROP privs for production?](https://www.ruby-forum.com/t/user-without-alter-drop-privs-for-production/154149)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 0\
**Last updated:** [November 25, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/user-without-alter-drop-privs-for-production/154149 "2008-11-25T22:08:03Z")

</div>

Our department has started to develop some web-applications with Rails - finally breaking free of the java-for-everything approach. A lot of the pre-existing policies for deployment procedures will, naturally, need to …

---

## [Runt Recurring events](https://www.ruby-forum.com/t/runt-recurring-events/152998)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 3\
**Last updated:** [November 25, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/runt-recurring-events/152998 "2008-11-25T20:40:26Z")

</div>

I am planning on using Runt to calculate recurring events. I calculate a Runt object in the view and use it to see if it includes a certain date, which is populates from the database, and display the info for that da…

---

## [Keeping users logged in between browser launches](https://www.ruby-forum.com/t/keeping-users-logged-in-between-browser-launches/154071)

<div class="topic-metadata">

**Author:** [@skaufman](https://www.ruby-forum.com/u/skaufman)\
**Replies:** 3\
**Last updated:** [November 25, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/keeping-users-logged-in-between-browser-launches/154071 "2008-11-25T19:45:46Z")

</div>

I’ve got several several Rails 2.1 apps using a variant of restful\_authentication to manage logins/sessions (actually the guts from Beast but it’s basically restful\_authentication). The apps store sessions in cookies …

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

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