# Rails

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

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

---

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

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 1\
**Last updated:** [June 30, 2008, 10:37am UTC](https://www.ruby-forum.com/t/button-to-function/141733 "2008-06-30T10:37:49Z")

</div>

Hi I have \<%= button\_to\_function “Save As Resolved”,{‘class’ =\> ‘itilbuttonlink1’} do |page| page.visual\_effect :BlindDown, ‘here\_call\_sd\_resolution\_div’ end %\> Here can I use :before clause as in the case of link\_…

---

## [Calling a controller method in javascript](https://www.ruby-forum.com/t/calling-a-controller-method-in-javascript/141654)

<div class="topic-metadata">

**Author:** [@Shripad](https://www.ruby-forum.com/u/Shripad)\
**Replies:** 5\
**Last updated:** [June 30, 2008, 9:59am UTC](https://www.ruby-forum.com/t/calling-a-controller-method-in-javascript/141654 "2008-06-30T09:59:45Z")

</div>

Hi all, I want to call a method present in ROR controller in my javascript for performing some logout activities. How can I do this Please help me Thanks and regards,

---

## [Value Change Sensitivity](https://www.ruby-forum.com/t/value-change-sensitivity/141743)

<div class="topic-metadata">

**Author:** [@shenley](https://www.ruby-forum.com/u/shenley)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 9:49am UTC](https://www.ruby-forum.com/t/value-change-sensitivity/141743 "2008-06-30T09:49:48Z")

</div>

How do I do something like this : i = 0 a = Thread.new { i.valueChange { | val | puts "i is now #{val} } } b = Thread.new { i = 2 # =\> “i is now 2” } a.join b.join The idea is everytime the value of i changes, …

---

## [Configure Rails app to use certain gem version](https://www.ruby-forum.com/t/configure-rails-app-to-use-certain-gem-version/141741)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 9:41am UTC](https://www.ruby-forum.com/t/configure-rails-app-to-use-certain-gem-version/141741 "2008-06-30T09:41:02Z")

</div>

Hi all, I use a shared host (Dreamhost) and have installed my own RMagick gem. I understood that I need to configure rails that it uses my gem and not the version on the server. Can I somehow configure a global confi…

---

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

<div class="topic-metadata">

**Author:** [@bewhite](https://www.ruby-forum.com/u/bewhite)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 8:24am UTC](https://www.ruby-forum.com/t/nested-resources-routes/141735 "2008-06-30T08:24:27Z")

</div>

Hi! I’ve got a quick question in routing. Is there any difference between map.resources :stuff, :has\_many =\> :inner\_stuff AND map.resources :stuff do |stuff| stuff.resources :inner\_stuff end ? Both calls seem to…

---

## [Problem in script/generate scaffold](https://www.ruby-forum.com/t/problem-in-script-generate-scaffold/141648)

<div class="topic-metadata">

**Author:** [@suri](https://www.ruby-forum.com/u/suri)\
**Replies:** 4\
**Last updated:** [June 30, 2008, 8:17am UTC](https://www.ruby-forum.com/t/problem-in-script-generate-scaffold/141648 "2008-06-30T08:17:01Z")

</div>

hi, i have installed ruby 1.8.6 window version, rails 2.1.0 everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions e,g. C:depot\>ruby script/generate scaffol…

---

## [Script/generate scaffold Products Admin----not running](https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649)

<div class="topic-metadata">

**Author:** [@suri](https://www.ruby-forum.com/u/suri)\
**Replies:** 2\
**Last updated:** [June 30, 2008, 8:13am UTC](https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649 "2008-06-30T08:13:12Z")

</div>

hi, i have installed ruby 1.8.6 window version, rails 2.1.0 everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions e,g. C:depot\>ruby script/generate scaffol…

---

## [Date Field convert to Seconds since Epoch](https://www.ruby-forum.com/t/date-field-convert-to-seconds-since-epoch/141667)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 14\
**Last updated:** [June 30, 2008, 7:43am UTC](https://www.ruby-forum.com/t/date-field-convert-to-seconds-since-epoch/141667 "2008-06-30T07:43:52Z")

</div>

Hi, I was wandering if anyone could help me with this problem: Right now I am using a field in my database which is of type ‘Date’ (in the form dd-mm-yyyy). I would like to convert this value (for example 26-06-08) in…

---

## [Working around Restful Authentication](https://www.ruby-forum.com/t/working-around-restful-authentication/141693)

<div class="topic-metadata">

**Author:** [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Replies:** 1\
**Last updated:** [June 30, 2008, 7:35am UTC](https://www.ruby-forum.com/t/working-around-restful-authentication/141693 "2008-06-30T07:35:06Z")

</div>

I’m using Restful Authentication, and the code to create a user is pretty straight forward - there is a before\_save action and a before\_create action: before\_save :encrypt\_password before\_create :make\_activation\_code …

---

## [tkTable and Rails](https://www.ruby-forum.com/t/tktable-and-rails/196730)

<div class="topic-metadata">

**Author:** [@ponravikumar](https://www.ruby-forum.com/u/ponravikumar)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 6:58am UTC](https://www.ruby-forum.com/t/tktable-and-rails/196730 "2008-06-30T06:58:57Z")

</div>

Hi, I want to use the TkTable in Rails application. For the tables in HTML editing and add the flash mode are not possible. I want to use these functionalities in my rails application. How do I achieve it. If any o…

---

## [Making a copy of a model and all its associated records](https://www.ruby-forum.com/t/making-a-copy-of-a-model-and-all-its-associated-records/141725)

<div class="topic-metadata">

**Author:** [@Diego](https://www.ruby-forum.com/u/Diego)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 6:32am UTC](https://www.ruby-forum.com/t/making-a-copy-of-a-model-and-all-its-associated-records/141725 "2008-06-30T06:32:31Z")

</div>

Hi all, I have a question regarding the duplication of a model and it’s associations. For example, if I have ModelA and it has\_many SubModelAs and has\_many SubModelBs associated with it. Each of the SubModels a belon…

---

## [Manage as a single action in place of new/edit/create/update/show](https://www.ruby-forum.com/t/manage-as-a-single-action-in-place-of-new-edit-create-update-show/141724)

<div class="topic-metadata">

**Author:** [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Replies:** 1\
**Last updated:** [June 30, 2008, 6:10am UTC](https://www.ruby-forum.com/t/manage-as-a-single-action-in-place-of-new-edit-create-update-show/141724 "2008-06-30T06:10:00Z")

</div>

Hello! Has anyone refactored the REST/CRUD actions into a single “manage” action? I’m finding that often new and edit are so close the it’s awfully non-DRY to have a separate new and edit action. And same with create…

---

## [Session expire](https://www.ruby-forum.com/t/session-expire/141607)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [June 30, 2008, 5:52am UTC](https://www.ruby-forum.com/t/session-expire/141607 "2008-06-30T05:52:34Z")

</div>

Hi all, I have set a session session to expire after an hour by doing: session\[:expire\] = { :expires =\> 1.hour.from\_now } What I would like to do is have it so that session gets reset back an hour whenever a new page…

---

## [Log4r warning message](https://www.ruby-forum.com/t/log4r-warning-message/141722)

<div class="topic-metadata">

**Author:** [@nahabed](https://www.ruby-forum.com/u/nahabed)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 5:00am UTC](https://www.ruby-forum.com/t/log4r-warning-message/141722 "2008-06-30T05:00:07Z")

</div>

I installed log4r as a gem on Max OS X Leopard. When I start the server locally, I have a warning that I’d like to get rid of. I think this is a side-effect of log4r? Other rails projects that I am working on, on the …

---

## [AVG antivirus interferes with webbrick locally?](https://www.ruby-forum.com/t/avg-antivirus-interferes-with-webbrick-locally/141678)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [June 29, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/avg-antivirus-interferes-with-webbrick-locally/141678 "2008-06-29T22:54:37Z")

</div>

Has anyone seen a problem like this … I have avg on windows XP. Running webbrick, often when I define a new controller or action, when I try to access it, avg intercepts it and redirects it to some other page not fou…

---

## [First try using RSpec on a simple Rails 2.0 app](https://www.ruby-forum.com/t/first-try-using-rspec-on-a-simple-rails-2-0-app/141712)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 1\
**Last updated:** [June 29, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/first-try-using-rspec-on-a-simple-rails-2-0-app/141712 "2008-06-29T22:49:22Z")

</div>

Hi, I’ve got a Rails 2.0 app “AIMS\_1” with one model, “Portfolio”. (I’m following David C.’s 2007 tutorial at http://blog.davidchelimsky.net/articles/2007/05/14/an-introduction-to-rspec-part-i). Portfolio has two …

---

## [Who can give some test example about ror+extjs](https://www.ruby-forum.com/t/who-can-give-some-test-example-about-ror-extjs/141711)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 0\
**Last updated:** [June 29, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/who-can-give-some-test-example-about-ror-extjs/141711 "2008-06-29T22:16:54Z")

</div>

I used the ror + extjs. But now, the question about how to write the functional test puzzled me. For example,if I used the pure ror framework,I will use redirect\_to to end the function,but I must use render :json =\> {…

---

## [How to write test about validates\_associated](https://www.ruby-forum.com/t/how-to-write-test-about-validates-associated/141679)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 2\
**Last updated:** [June 29, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/how-to-write-test-about-validates-associated/141679 "2008-06-29T22:00:50Z")

</div>

Here is my model: class Account \< ActiveRecord::Base has\_many :users, :dependent =\> :destroy has\_many :bus belongs\_to :currency has\_many :mylogs, :dependent =\> :destroy has\_many :batchuserdefines, :dependent =\> :de…

---

## [URL with decimals. How to allow in routes?](https://www.ruby-forum.com/t/url-with-decimals-how-to-allow-in-routes/141688)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 1\
**Last updated:** [June 29, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/url-with-decimals-how-to-allow-in-routes/141688 "2008-06-29T19:38:22Z")

</div>

Hi, I have a resource that can take latitue and longitude. I have defined those in the DB as: t.decimal :lat, :precision =\> 15, :scale =\> 10 t.decimal :lng, :precision =\> 15, :scale =\> 10 I have set the route so I c…

---

## [Programming partner wanted â€“ sport interes t beneficial](https://www.ruby-forum.com/t/programming-partner-wanted-a-sport-interes-t-beneficial/141692)

<div class="topic-metadata">

**Author:** [@UncoverSports](https://www.ruby-forum.com/u/UncoverSports)\
**Replies:** 1\
**Last updated:** [June 29, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/programming-partner-wanted-a-sport-interes-t-beneficial/141692 "2008-06-29T18:34:33Z")

</div>

Hello, I’m a sports journalist that has spent 10 years working in the media with half of that focusing on online sports media. I’ve recently established a business and commenced mapping out a website system that I wo…

---

## [Upgrade to 2.1](https://www.ruby-forum.com/t/upgrade-to-2-1/141696)

<div class="topic-metadata">

**Author:** [@eyp](https://www.ruby-forum.com/u/eyp)\
**Replies:** 1\
**Last updated:** [June 29, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/upgrade-to-2-1/141696 "2008-06-29T18:12:53Z")

</div>

Hello, I’m developing an app on RoR 2.0.2. What must I do to upgrade to 2.1?, install the gem and change environment.rb in order to point to 2.1, is it enough?

---

## [New Ruby on Rails Windows group](https://www.ruby-forum.com/t/new-ruby-on-rails-windows-group/141699)

<div class="topic-metadata">

**Author:** [@caliwildman](https://www.ruby-forum.com/u/caliwildman)\
**Replies:** 0\
**Last updated:** [June 29, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/new-ruby-on-rails-windows-group/141699 "2008-06-29T17:57:44Z")

</div>

At the suggestion of a fellow RoR Windows developer, we thought it is a good idea to create a separate group for RoR Windows developers seeing how Windows issues tend to be rather different than Linux. Here is the new…

---

## [Correlate Ruby version/build with patch number](https://www.ruby-forum.com/t/correlate-ruby-version-build-with-patch-number/141669)

<div class="topic-metadata">

**Author:** [@caliwildman](https://www.ruby-forum.com/u/caliwildman)\
**Replies:** 7\
**Last updated:** [June 29, 2008, 5:40pm UTC](https://www.ruby-forum.com/t/correlate-ruby-version-build-with-patch-number/141669 "2008-06-29T17:40:08Z")

</div>

I heard from a couple of sources about Ruby security concerns, quoting from http://www.rubyinside.com/june-2008-ruby-security-vulnerabilities-927.html The official Ruby blog is reporting â€œmultiple vulnerabilitiesâ€…

---

## [Leftover gems after upgrading to Rails 2.1](https://www.ruby-forum.com/t/leftover-gems-after-upgrading-to-rails-2-1/141614)

<div class="topic-metadata">

**Author:** [@caliwildman](https://www.ruby-forum.com/u/caliwildman)\
**Replies:** 13\
**Last updated:** [June 29, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/leftover-gems-after-upgrading-to-rails-2-1/141614 "2008-06-29T17:15:28Z")

</div>

My current dev setup is Ruby 1.8.5 and Rails 1.2.1 on Windows XP. Initially I planned on upgrading Ruby to 1.8.6 and Rails to 2.1 but decided against the Ruby upgrade after some research. I did upgrade Rails to 2.1 th…

---

## [Many-to-many on a single table?](https://www.ruby-forum.com/t/many-to-many-on-a-single-table/141673)

<div class="topic-metadata">

**Author:** [@robb](https://www.ruby-forum.com/u/robb)\
**Replies:** 3\
**Last updated:** [June 29, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/many-to-many-on-a-single-table/141673 "2008-06-29T17:13:41Z")

</div>

Hi, I’m implementing a M-M relationship with a single table upon itself, and wonder if there’s anything I should look out for in rails, when doing this. Also, what notation I would best use in Rails (I’m guessing :t…

---

## [Working around/with Restful Authentication](https://www.ruby-forum.com/t/working-around-with-restful-authentication/196729)

<div class="topic-metadata">

**Author:** [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Replies:** 3\
**Last updated:** [June 29, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/working-around-with-restful-authentication/196729 "2008-06-29T16:27:30Z")

</div>

I’m using Restful Authentication, and the code to create a user is pretty straight forward - there is a before\_save action and a before\_create action: before\_save :encrypt\_password before\_create :make\_activation\_code …

---

## [Where should I put "sync database to an excel spreadsheet" capability](https://www.ruby-forum.com/t/where-should-i-put-sync-database-to-an-excel-spreadsheet-capability/141675)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 1\
**Last updated:** [June 29, 2008, 5:19am UTC](https://www.ruby-forum.com/t/where-should-i-put-sync-database-to-an-excel-spreadsheet-capability/141675 "2008-06-29T05:19:40Z")

</div>

I don’t know if anybody else has ever tried anything even remotely resembling this, but I am in the process of taking a bunch o’ data currently maintained in an excel spreadsheet, and trying to write a slick RoR datab…

---

## [Extra level of has\_many :through](https://www.ruby-forum.com/t/extra-level-of-has-many-through/141659)

<div class="topic-metadata">

**Author:** [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Replies:** 6\
**Last updated:** [June 29, 2008, 1:29am UTC](https://www.ruby-forum.com/t/extra-level-of-has-many-through/141659 "2008-06-29T01:29:55Z")

</div>

If I have a model scheme like this: Company 1—\* Customer 1—\* Car 1—\* Workcard Or in Rails language: class Company \< ActiveRecord::Base has\_many :customers end class Customer \< ActiveRecord::Base belongs\_to :compan…

---

## [I cannot run rails -v](https://www.ruby-forum.com/t/i-cannot-run-rails-v/123747)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 8\
**Last updated:** [June 29, 2008, 1:00am UTC](https://www.ruby-forum.com/t/i-cannot-run-rails-v/123747 "2008-06-29T01:00:45Z")

</div>

Hi, After I update rails I cannot run rails -v anymore? sudo gem update rails Password: Updating installed gems… Bulk updating Gem source index for: http://gems.rubyforge.org Attempting remote update of rails Succ…

---

## [Complex/nested relationships](https://www.ruby-forum.com/t/complex-nested-relationships/141621)

<div class="topic-metadata">

**Author:** [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Replies:** 4\
**Last updated:** [June 28, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/complex-nested-relationships/141621 "2008-06-28T23:52:51Z")

</div>

Hello, I’m relatively new to Rails and had a question about how to best set up relationships between a few of my objects. Right now, I’ve got the following model objects: Transmission List Technique A Transmission …

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

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