# Rails

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

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

---

## [Routes.rb](https://www.ruby-forum.com/t/routes-rb/155656)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 2\
**Last updated:** [December 15, 2008, 11:27am UTC](https://www.ruby-forum.com/t/routes-rb/155656 "2008-12-15T11:27:26Z")

</div>

Hi, I am going through a tutorial in a rails book. I have Something off with routes: I have RESTful resource in routes.rb: “… map.resources :users, :member =\> { :enable =\> :put } do |users| users.resources :roles …

---

## [How to build index from model](https://www.ruby-forum.com/t/how-to-build-index-from-model/155610)

<div class="topic-metadata">

**Author:** [@astropanic](https://www.ruby-forum.com/u/astropanic)\
**Replies:** 2\
**Last updated:** [December 15, 2008, 11:17am UTC](https://www.ruby-forum.com/t/how-to-build-index-from-model/155610 "2008-12-15T11:17:28Z")

</div>

Hi, I have a application where I have a book model. I have a book controller, it has an action named “index\_titles” What should I write in the action of this controller to get a list with the distinct first letters f…

---

## [ActiveRecord private method called](https://www.ruby-forum.com/t/activerecord-private-method-called/155631)

<div class="topic-metadata">

**Author:** [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Replies:** 1\
**Last updated:** [December 15, 2008, 10:13am UTC](https://www.ruby-forum.com/t/activerecord-private-method-called/155631 "2008-12-15T10:13:33Z")

</div>

Ok so i just upgraded to rails 2.2.2 and now i’m getting error “Attempt to call private method”. I found out that this is because my planet model has attribute named y, which seems is a private attribute in ActiveReco…

---

## [Should the "schema migrations" table have more than one row?](https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 2\
**Last updated:** [December 15, 2008, 10:01am UTC](https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646 "2008-12-15T10:01:47Z")

</div>

Hi, Should the “schema migrations” table have more than one row??? If yes how do you know what the current version is supposed to be? I noted mine looks like the following. Is this a problem? mysql\> select \* from …

---

## [RoR + AJAX + Safari = 500 Internal Server Error](https://www.ruby-forum.com/t/ror-ajax-safari-500-internal-server-error/128546)

<div class="topic-metadata">

**Author:** [@Whit\_Nelson](https://www.ruby-forum.com/u/Whit_Nelson)\
**Replies:** 8\
**Last updated:** [December 15, 2008, 8:22am UTC](https://www.ruby-forum.com/t/ror-ajax-safari-500-internal-server-error/128546 "2008-12-15T08:22:16Z")

</div>

Hi everyone, I am running essentially the stock AJAX demo from here, and it is working fine in every browser except one. Nope! Not that one! It’s actually Safari which is giving me trouble. I know! Using a link\_to\_…

---

## [How to create a new page using link\_to and how to do searching in the page created?](https://www.ruby-forum.com/t/how-to-create-a-new-page-using-link-to-and-how-to-do-searching-in-the-page-created/155644)

<div class="topic-metadata">

**Author:** [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Replies:** 0\
**Last updated:** [December 15, 2008, 8:10am UTC](https://www.ruby-forum.com/t/how-to-create-a-new-page-using-link-to-and-how-to-do-searching-in-the-page-created/155644 "2008-12-15T08:10:34Z")

</div>

hi, I have implimented a application for searching the streams from streams table. Presently if i invoke the index page i am seeing the listing of all streams and search box on the same page and after searching, the …

---

## [Initializing list with account creation](https://www.ruby-forum.com/t/initializing-list-with-account-creation/155623)

<div class="topic-metadata">

**Author:** [@nek4life](https://www.ruby-forum.com/u/nek4life)\
**Replies:** 2\
**Last updated:** [December 15, 2008, 6:21am UTC](https://www.ruby-forum.com/t/initializing-list-with-account-creation/155623 "2008-12-15T06:21:49Z")

</div>

I have a model for users and a model for lists and a model for the items. I have a one-to-one relationship with the user and the list so only one list may be created. I’m having problems when I try to create the list…

---

## [Link\_to problem](https://www.ruby-forum.com/t/link-to-problem/155637)

<div class="topic-metadata">

**Author:** [@mrbless](https://www.ruby-forum.com/u/mrbless)\
**Replies:** 0\
**Last updated:** [December 15, 2008, 6:05am UTC](https://www.ruby-forum.com/t/link-to-problem/155637 "2008-12-15T06:05:26Z")

</div>

Hi guys I face a strange problem. I have written link\_to like this \<%= link\_to “TestGroup”, :controller=\>‘group’, :action=\>‘group\_description’, :id=\>“Web 2.0” %\> then i raise params in controller and found that pa…

---

## [Many to many and delete question](https://www.ruby-forum.com/t/many-to-many-and-delete-question/155630)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 1\
**Last updated:** [December 15, 2008, 5:54am UTC](https://www.ruby-forum.com/t/many-to-many-and-delete-question/155630 "2008-12-15T05:54:18Z")

</div>

I have a “has\_and\_belongs\_to\_many” relationship between two tables, meaning I have a join table that contains the two ids of each table. For simplicity let’s call them “foo” and “bar”. I want to delete a bar from a fo…

---

## [Search function implimentaion with the tag name as the search box entry](https://www.ruby-forum.com/t/search-function-implimentaion-with-the-tag-name-as-the-search-box-entry/155288)

<div class="topic-metadata">

**Author:** [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Replies:** 22\
**Last updated:** [December 15, 2008, 5:14am UTC](https://www.ruby-forum.com/t/search-function-implimentaion-with-the-tag-name-as-the-search-box-entry/155288 "2008-12-15T05:14:01Z")

</div>

hi i am implimenting the search function using tags. i have tables called streams and tags. each entry of the table have a single or multiple tagnames(i am using acts\_as\_taggable\_on\_steroids for tagging). streams ta…

---

## [Ajax link in select\_tag options - problem](https://www.ruby-forum.com/t/ajax-link-in-select-tag-options-problem/155638)

<div class="topic-metadata">

**Author:** [@kalakala](https://www.ruby-forum.com/u/kalakala)\
**Replies:** 0\
**Last updated:** [December 15, 2008, 4:37am UTC](https://www.ruby-forum.com/t/ajax-link-in-select-tag-options-problem/155638 "2008-12-15T04:37:14Z")

</div>

Hi all, I am a newbie with RoR and am currently stuck with this problem: I have an “ADD CATEGORY” option in the drop down menu for selection, ADD CATEGORY is followed by categories I already added, now when I select …

---

## [Need Help in converting php encryption decryption code to ruby on rails](https://www.ruby-forum.com/t/need-help-in-converting-php-encryption-decryption-code-to-ruby-on-rails/155534)

<div class="topic-metadata">

**Author:** [@MrSBless](https://www.ruby-forum.com/u/MrSBless)\
**Replies:** 2\
**Last updated:** [December 15, 2008, 3:50am UTC](https://www.ruby-forum.com/t/need-help-in-converting-php-encryption-decryption-code-to-ruby-on-rails/155534 "2008-12-15T03:50:27Z")

</div>

Hi guys i found this encryption decryption in php and try to convert it in rails but i am unable to successfully convert it. So plz help me. I you write the whole conversion code then it will be great. PHP code is lik…

---

## [ActionMailer, unit testing and multipart mails](https://www.ruby-forum.com/t/actionmailer-unit-testing-and-multipart-mails/154605)

<div class="topic-metadata">

**Author:** [@trejkaz](https://www.ruby-forum.com/u/trejkaz)\
**Replies:** 4\
**Last updated:** [December 15, 2008, 3:32am UTC](https://www.ruby-forum.com/t/actionmailer-unit-testing-and-multipart-mails/154605 "2008-12-15T03:32:18Z")

</div>

Hi all. Is there a “correct” way of writing a unit test for a mailer which sends attachments? I tried using the @expected variable as provided in ActionMailer::TestCase, but it led to various problems. Here’s what I…

---

## [Problem with Acts As Versioned and Save v. Save Without Revision](https://www.ruby-forum.com/t/problem-with-acts-as-versioned-and-save-v-save-without-revision/155100)

<div class="topic-metadata">

**Author:** [@blacknight](https://www.ruby-forum.com/u/blacknight)\
**Replies:** 2\
**Last updated:** [December 15, 2008, 3:30am UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned-and-save-v-save-without-revision/155100 "2008-12-15T03:30:32Z")

</div>

Okay, I had a legacy table that had no versioning. I added Acts As Versioned, by adding the “version” column to said database, and adding the acts\_as\_versioned to the model. When I tried to “save()” a record, I got an…

---

## [How to draw a large chart?](https://www.ruby-forum.com/t/how-to-draw-a-large-chart/155468)

<div class="topic-metadata">

**Author:** [@takkeeeeee](https://www.ruby-forum.com/u/takkeeeeee)\
**Replies:** 4\
**Last updated:** [December 15, 2008, 2:36am UTC](https://www.ruby-forum.com/t/how-to-draw-a-large-chart/155468 "2008-12-15T02:36:53Z")

</div>

I am meeting a big problem with charts. I have to display a horizontal bar chart with ~3000 bars in ~5s. Assume the input data are ready in the needed format. I have tested open flash chart, gruff, scruffy… They all f…

---

## [Passing local to template to partial](https://www.ruby-forum.com/t/passing-local-to-template-to-partial/155590)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 4\
**Last updated:** [December 15, 2008, 2:23am UTC](https://www.ruby-forum.com/t/passing-local-to-template-to-partial/155590 "2008-12-15T02:23:11Z")

</div>

I want to pass an array to a template as a local variable. The template passes the same local variable to a partial as a local variable. This isn’t working as I expect and something in the back of my mind is says th…

---

## [Mysql problem](https://www.ruby-forum.com/t/mysql-problem/155626)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [December 14, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/mysql-problem/155626 "2008-12-14T23:01:34Z")

</div>

i have a problem on rails (error message Mysql::Error in FokashController#index

---

## [How to restrict access to my deploy.rb file?](https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160)

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 2\
**Last updated:** [December 14, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/how-to-restrict-access-to-my-deploy-rb-file/153160 "2008-12-14T22:08:59Z")

</div>

I would like to restrict the access to the deploy.rb file to prevent any mods from anybody that could cause major issue in production zone for instance. I do know that I can keep the deploy.rb any from the project. I…

---

## [12\_hour\_time plugin broken in 2.2](https://www.ruby-forum.com/t/12-hour-time-plugin-broken-in-2-2/154054)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 5\
**Last updated:** [December 14, 2008, 10:01pm UTC](https://www.ruby-forum.com/t/12-hour-time-plugin-broken-in-2-2/154054 "2008-12-14T22:01:54Z")

</div>

This is a widely used plugin I’m guessing and its broken in rails 2.2. Could someone please take a look at it? http://code.google.com/p/rails-twelve-hour-time-plugin/issues/detail?id=5

---

## [Capture session end of life routine? def session\_has\_ended?](https://www.ruby-forum.com/t/capture-session-end-of-life-routine-def-session-has-ended/155571)

<div class="topic-metadata">

**Author:** [@mrpete](https://www.ruby-forum.com/u/mrpete)\
**Replies:** 1\
**Last updated:** [December 14, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/capture-session-end-of-life-routine-def-session-has-ended/155571 "2008-12-14T21:40:18Z")

</div>

Does RoR define a routine that runs guaranteed when a session ends to write out session info to database, etc.? Pete

---

## [\[announce\] wordfractal.com and \[question\] OpenId or FB Connect?](https://www.ruby-forum.com/t/announce-wordfractal-com-and-question-openid-or-fb-connect/155596)

<div class="topic-metadata">

**Author:** [@shogusumi](https://www.ruby-forum.com/u/shogusumi)\
**Replies:** 1\
**Last updated:** [December 14, 2008, 9:33pm UTC](https://www.ruby-forum.com/t/announce-wordfractal-com-and-question-openid-or-fb-connect/155596 "2008-12-14T21:33:06Z")

</div>

Just a quick shout out to the rails community about my new Pick Your Own Destiny (or write a new one!) site I put together in rails : http://www.wordfractal.com/. I’ve recently tried to streamline it a bit to make it …

---

## [Consts for symbols or too anal?](https://www.ruby-forum.com/t/consts-for-symbols-or-too-anal/155521)

<div class="topic-metadata">

**Author:** [@jbell38](https://www.ruby-forum.com/u/jbell38)\
**Replies:** 1\
**Last updated:** [December 14, 2008, 8:28pm UTC](https://www.ruby-forum.com/t/consts-for-symbols-or-too-anal/155521 "2008-12-14T20:28:55Z")

</div>

Soliciting some opinions here. I keep having this urge to create constants for some of my symbol keys, so the Ruby interpreter catches my typos. I’m wondering how other developers handle this / what Rails best practic…

---

## [Need to initialize contant arrays , where to do it](https://www.ruby-forum.com/t/need-to-initialize-contant-arrays-where-to-do-it/155569)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 1\
**Last updated:** [December 14, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/need-to-initialize-contant-arrays-where-to-do-it/155569 "2008-12-14T20:15:41Z")

</div>

I need to load names, from the table ‘domains’ into an array (frequently used in my app…) ALL\_DOMAINS = Domain.find(:all).map { |d| d.name }.compact I tried to write it in an initialize or in my application.rb BUT p…

---

## [Database cleaning](https://www.ruby-forum.com/t/database-cleaning/155618)

<div class="topic-metadata">

**Author:** [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Replies:** 1\
**Last updated:** [December 14, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/database-cleaning/155618 "2008-12-14T20:04:29Z")

</div>

Although i’m using validations in my models, i’ve managed to get a few duplicate entries on my site. I’ve got roughly 300,000 entries, and my administration only allows long running rake tasks of up to 5 hours. I need…

---

## [jQuery post function](https://www.ruby-forum.com/t/jquery-post-function/155617)

<div class="topic-metadata">

**Author:** [@daz](https://www.ruby-forum.com/u/daz)\
**Replies:** 0\
**Last updated:** [December 14, 2008, 7:14pm UTC](https://www.ruby-forum.com/t/jquery-post-function/155617 "2008-12-14T19:14:53Z")

</div>

If you use jQuery to post data, what is the accepted best practice for passing parameters - by putting a query string in the url, or passing them through the data argument of the function? e.g. $.post(/tasks/3?comple…

---

## [ActionController::TestRequest bug?](https://www.ruby-forum.com/t/actioncontroller-testrequest-bug/155616)

<div class="topic-metadata">

**Author:** [@pk16](https://www.ruby-forum.com/u/pk16)\
**Replies:** 0\
**Last updated:** [December 14, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/actioncontroller-testrequest-bug/155616 "2008-12-14T19:11:22Z")

</div>

Hi, while starting to setup functional tests for my application I received the following error: NoMethodError: undefined method \`server\_name’ for #\<ActionController::TestRequest which is coming from an instance varia…

---

## [Updates using urls and query strings](https://www.ruby-forum.com/t/updates-using-urls-and-query-strings/155570)

<div class="topic-metadata">

**Author:** [@daz](https://www.ruby-forum.com/u/daz)\
**Replies:** 4\
**Last updated:** [December 14, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/updates-using-urls-and-query-strings/155570 "2008-12-14T19:11:22Z")

</div>

I have a task model and in the controller there is this code that sets the date a task was completed on if params\[:completed\] comes back as true and sets the completed\_by field to nil (ie incomplete) if params \[:compl…

---

## [Custom REST action - template question](https://www.ruby-forum.com/t/custom-rest-action-template-question/155603)

<div class="topic-metadata">

**Author:** [@Pavel\_Krusek](https://www.ruby-forum.com/u/Pavel_Krusek)\
**Replies:** 2\
**Last updated:** [December 14, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/custom-rest-action-template-question/155603 "2008-12-14T17:02:57Z")

</div>

Hallo phorum, i have custom rest action. routes.rb: map.resources :schools, :collection =\> { :graduations =\> :get } SchoolsController: def graduations @schools = School.graduation(true) end link somewhere in navi…

---

## [Thin server processes slowly growing in RAM size](https://www.ruby-forum.com/t/thin-server-processes-slowly-growing-in-ram-size/155225)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 4\
**Last updated:** [December 14, 2008, 4:38pm UTC](https://www.ruby-forum.com/t/thin-server-processes-slowly-growing-in-ram-size/155225 "2008-12-14T16:38:49Z")

</div>

When I initially start up my server I have two thin processes running that are only about 200M in size. They slowly creep up a few megs an hour until now a week later they are at 400M and 300M respectively. I realize…

---

## [About query database and virtual attributes](https://www.ruby-forum.com/t/about-query-database-and-virtual-attributes/126671)

<div class="topic-metadata">

**Author:** [@flyingzumwalt](https://www.ruby-forum.com/u/flyingzumwalt)\
**Replies:** 3\
**Last updated:** [December 14, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/about-query-database-and-virtual-attributes/126671 "2008-12-14T16:21:22Z")

</div>

Hi, My model has a lot of virtual attributes. So when I use find(:all, :condition=\>blablabla), can I use virtual attribute directly? eg. in my model: def mydatetime self.date+self.time end can i just use “mydatet…

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

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