# Rails

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

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

---

## [Has one relationship through join table - orphaned records on update](https://www.ruby-forum.com/t/has-one-relationship-through-join-table-orphaned-records-on-update/186712)

<div class="topic-metadata">

**Author:** [@dbkbali](https://www.ruby-forum.com/u/dbkbali)\
**Replies:** 1\
**Last updated:** [April 12, 2010, 5:59am UTC](https://www.ruby-forum.com/t/has-one-relationship-through-join-table-orphaned-records-on-update/186712 "2010-04-12T05:59:51Z")

</div>

I have set up the following relationships Rails 2.3.5 and on update I am finding that orphaned records are generated. Are my relationships wrong or is there a recommended way to manage these orphaned records on an upd…

---

## [Dynamically linking to ajax.googleapis jquery](https://www.ruby-forum.com/t/dynamically-linking-to-ajax-googleapis-jquery/186580)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 2\
**Last updated:** [April 12, 2010, 5:52am UTC](https://www.ruby-forum.com/t/dynamically-linking-to-ajax-googleapis-jquery/186580 "2010-04-12T05:52:50Z")

</div>

Hi I am using jquery and jqueryui in my application And in layout I use \<%= javascript\_include\_tag “http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js”%\> \<%= javascript\_include\_tag “http://ajax.googleap…

---

## [Don't Automatically start SESSION?](https://www.ruby-forum.com/t/dont-automatically-start-session/186637)

<div class="topic-metadata">

**Author:** [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Replies:** 4\
**Last updated:** [April 12, 2010, 5:38am UTC](https://www.ruby-forum.com/t/dont-automatically-start-session/186637 "2010-04-12T05:38:46Z")

</div>

Hey, i created a user authentication system with authlogic, everytime a user registers, the user is created, AND the user\_session is automatically started, and the new user is considered logged in. Is it possible to …

---

## [Please help; form\_for passes nil](https://www.ruby-forum.com/t/please-help-form-for-passes-nil/186243)

<div class="topic-metadata">

**Author:** [@dirtbug](https://www.ruby-forum.com/u/dirtbug)\
**Replies:** 23\
**Last updated:** [April 11, 2010, 10:35pm UTC](https://www.ruby-forum.com/t/please-help-form-for-passes-nil/186243 "2010-04-11T22:35:47Z")

</div>

I have an update button that doesn’t update. Watching the server during the attempt, I see: Processing OrvesController#update (for 128.119.60.171 at 2010-04-02 13:13:29) \[PUT\] Parameters: {“orf”=\>nil, “commit”=\>“Upd…

---

## [Export contents to Word DOC file](https://www.ruby-forum.com/t/export-contents-to-word-doc-file/186698)

<div class="topic-metadata">

**Author:** [@amabdelsalam](https://www.ruby-forum.com/u/amabdelsalam)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 10:03pm UTC](https://www.ruby-forum.com/t/export-contents-to-word-doc-file/186698 "2010-04-11T22:03:59Z")

</div>

Hi, I want to export some contents from my rails application to MS WORD .doc file Any help?

---

## [Moving to Widgets from Standard Rails UI](https://www.ruby-forum.com/t/moving-to-widgets-from-standard-rails-ui/186632)

<div class="topic-metadata">

**Author:** [@smarter](https://www.ruby-forum.com/u/smarter)\
**Replies:** 5\
**Last updated:** [April 11, 2010, 6:30pm UTC](https://www.ruby-forum.com/t/moving-to-widgets-from-standard-rails-ui/186632 "2010-04-11T18:30:09Z")

</div>

Hi: I am planning to move my app from Standard Rails UI with form\_for to using widgets from jQuery/ExtJS… Most of these take json format. I can easily get JSON Format from Rails model, but updates will also send JSO…

---

## [How to convert a "time difference" into "x days, y hours..."](https://www.ruby-forum.com/t/how-to-convert-a-time-difference-into-x-days-y-hours/186694)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 3\
**Last updated:** [April 11, 2010, 6:08pm UTC](https://www.ruby-forum.com/t/how-to-convert-a-time-difference-into-x-days-y-hours/186694 "2010-04-11T18:08:04Z")

</div>

Hi there, how can I convert something like… future\_datetime - past\_datetime (which results in a float) into something like… “21 days, 2 hours, 53 minutes, 1 seconds” ? Does RoR have any nifty helper for this ? Tha…

---

## [Caching html / blobs / ActiveRecords](https://www.ruby-forum.com/t/caching-html-blobs-activerecords/186689)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 0\
**Last updated:** [April 11, 2010, 4:46pm UTC](https://www.ruby-forum.com/t/caching-html-blobs-activerecords/186689 "2010-04-11T16:46:25Z")

</div>

Short question: what caching packages are available for Rails? Details: My application requires data scraped from various web sites. To date, I’ve used scripts to fetch the page in question. Since I never want to hit…

---

## [Not getting validation error message](https://www.ruby-forum.com/t/not-getting-validation-error-message/186679)

<div class="topic-metadata">

**Author:** [@rahul\_m](https://www.ruby-forum.com/u/rahul_m)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 2:40pm UTC](https://www.ruby-forum.com/t/not-getting-validation-error-message/186679 "2010-04-11T14:40:33Z")

</div>

i have one comment controller to put comment on article i have used this form add in my website part or some other controller put two validation validates\_presence\_of(:name,:comment) code of other controller @comm…

---

## [Rendering a Partial as an Alternative](https://www.ruby-forum.com/t/rendering-a-partial-as-an-alternative/186630)

<div class="topic-metadata">

**Author:** [@djames](https://www.ruby-forum.com/u/djames)\
**Replies:** 5\
**Last updated:** [April 11, 2010, 10:09am UTC](https://www.ruby-forum.com/t/rendering-a-partial-as-an-alternative/186630 "2010-04-11T10:09:54Z")

</div>

Suppose that I want to have a block of default content within a template that is replaced with the content of a specific partial only if that partial exists. Obviously there is the brute force approach of simply rend…

---

## [Migration update with multiple joined tables](https://www.ruby-forum.com/t/migration-update-with-multiple-joined-tables/186671)

<div class="topic-metadata">

**Author:** [@davidjrice](https://www.ruby-forum.com/u/davidjrice)\
**Replies:** 2\
**Last updated:** [April 11, 2010, 2:08am UTC](https://www.ruby-forum.com/t/migration-update-with-multiple-joined-tables/186671 "2010-04-11T02:08:16Z")

</div>

I’m trying to do an update that requires table joins but I can’t find any examples of updates beyond simple attribute value assignments. I have a select statement like this: SELECT title, state, name FROM posts, zips…

---

## [Can't Convert Symbol into Integer](https://www.ruby-forum.com/t/cant-convert-symbol-into-integer/186652)

<div class="topic-metadata">

**Author:** [@epasquier](https://www.ruby-forum.com/u/epasquier)\
**Replies:** 2\
**Last updated:** [April 11, 2010, 1:45am UTC](https://www.ruby-forum.com/t/cant-convert-symbol-into-integer/186652 "2010-04-11T01:45:05Z")

</div>

I must have really screwed something up big time. I was trying to modify SortHelper to work on multiple columns and now I can’t get anything to work even though I reverted all my changes. I keep getting the error: c…

---

## [Validations problem](https://www.ruby-forum.com/t/validations-problem/186601)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 5\
**Last updated:** [April 10, 2010, 10:53pm UTC](https://www.ruby-forum.com/t/validations-problem/186601 "2010-04-10T22:53:48Z")

</div>

Hello champs, I have a validation in model ABC and that is:- validates\_presence\_of :employee\_id Now the record should not be saved without the presence of employee\_id right. But now i wrote a test case like this:- d…

---

## [Ruby 1.8.7p249 + rails 2.3.5 + Snow Leopard = hung processes?](https://www.ruby-forum.com/t/ruby-1-8-7p249-rails-2-3-5-snow-leopard-hung-processes/186661)

<div class="topic-metadata">

**Author:** [@markds75](https://www.ruby-forum.com/u/markds75)\
**Replies:** 1\
**Last updated:** [April 10, 2010, 10:48pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7p249-rails-2-3-5-snow-leopard-hung-processes/186661 "2010-04-10T22:48:31Z")

</div>

A few weeks ago I updated my development computer to Snow Leopard (finally). I put it off because I was in the middle of a project, and it seems its a good thing I did. Last week I started something new and it seems t…

---

## [Restful authentication help : updates never reach database](https://www.ruby-forum.com/t/restful-authentication-help-updates-never-reach-database/186662)

<div class="topic-metadata">

**Author:** [@djconcepcion](https://www.ruby-forum.com/u/djconcepcion)\
**Replies:** 1\
**Last updated:** [April 10, 2010, 10:38pm UTC](https://www.ruby-forum.com/t/restful-authentication-help-updates-never-reach-database/186662 "2010-04-10T22:38:40Z")

</div>

my setup: OS X 10.6.3 rails (2.3.5) sqlite the problem: moving this old code to a new project (I didn’t want to hunt down yet-another-authentication module as I can’t tell what is abandoned or not, I figured copy p…

---

## [Version control system](https://www.ruby-forum.com/t/version-control-system/186634)

<div class="topic-metadata">

**Author:** [@pepe](https://www.ruby-forum.com/u/pepe)\
**Replies:** 7\
**Last updated:** [April 10, 2010, 8:59pm UTC](https://www.ruby-forum.com/t/version-control-system/186634 "2010-04-10T20:59:38Z")

</div>

Hello, I’m sorry if this is not the right place for this question. Please feel free to point me in the right direction. Also take into consideration that we have never used a version control system so my questions mi…

---

## [Test database and migrations](https://www.ruby-forum.com/t/test-database-and-migrations/186647)

<div class="topic-metadata">

**Author:** [@grar](https://www.ruby-forum.com/u/grar)\
**Replies:** 3\
**Last updated:** [April 10, 2010, 8:20pm UTC](https://www.ruby-forum.com/t/test-database-and-migrations/186647 "2010-04-10T20:20:25Z")

</div>

Hi, I’d like to have the results of a migration file that prepopulates my development database available for testing. So, right now, after the usual rake migration, I can access my prepopulated data via script/ conso…

---

## [ActionController::SessionRestoreError](https://www.ruby-forum.com/t/actioncontroller-sessionrestoreerror/186643)

<div class="topic-metadata">

**Author:** [@rahul\_m](https://www.ruby-forum.com/u/rahul_m)\
**Replies:** 6\
**Last updated:** [April 10, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/actioncontroller-sessionrestoreerror/186643 "2010-04-10T13:47:37Z")

</div>

Hiiiiiii created new application from old application copy of that the old application is running but new application is not running fine , please help its urgent… ActionController::SessionRestoreError in Content\_mas…

---

## [Dvalve! we called the heart of outsourcing world](https://www.ruby-forum.com/t/dvalve-we-called-the-heart-of-outsourcing-world/186645)

<div class="topic-metadata">

**Author:** [@Dvalve.com](https://www.ruby-forum.com/u/Dvalve.com)\
**Replies:** 0\
**Last updated:** [April 10, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/dvalve-we-called-the-heart-of-outsourcing-world/186645 "2010-04-10T12:40:18Z")

</div>

Dvalve.com is an online talent workplace that helps companies hire and manage professionals online to get work done and grow their businesses. Dvalve matches employers with a ready and qualified workforce and rated, t…

---

## [I need a new type of polymorphic has\_many association with dynamic foreign\_key](https://www.ruby-forum.com/t/i-need-a-new-type-of-polymorphic-has-many-association-with-dynamic-foreign-key/186524)

<div class="topic-metadata">

**Author:** [@joe](https://www.ruby-forum.com/u/joe)\
**Replies:** 6\
**Last updated:** [April 10, 2010, 6:47am UTC](https://www.ruby-forum.com/t/i-need-a-new-type-of-polymorphic-has-many-association-with-dynamic-foreign-key/186524 "2010-04-10T06:47:18Z")

</div>

A vanilla polymorphic belongs\_to association allows different association instances to have targets in different classes. I want to do a has\_many association where different association instances have different forei…

---

## [Making a registration form that requires user to be over 13 (COPPA compliant form)](https://www.ruby-forum.com/t/making-a-registration-form-that-requires-user-to-be-over-13-coppa-compliant-form/186440)

<div class="topic-metadata">

**Author:** [@The\_programmer](https://www.ruby-forum.com/u/The_programmer)\
**Replies:** 2\
**Last updated:** [April 10, 2010, 4:35am UTC](https://www.ruby-forum.com/t/making-a-registration-form-that-requires-user-to-be-over-13-coppa-compliant-form/186440 "2010-04-10T04:35:38Z")

</div>

Hi, In the U.S.A for anyone to have access to any site that allows you access to a chatroom, forum, anything that sends text over the internet you have to be over 13 unless everything everyone can say is from a pre-s…

---

## [Nested one-to-one forms question](https://www.ruby-forum.com/t/nested-one-to-one-forms-question/186628)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 2\
**Last updated:** [April 10, 2010, 3:00am UTC](https://www.ruby-forum.com/t/nested-one-to-one-forms-question/186628 "2010-04-10T03:00:34Z")

</div>

Hello, I must admit I’m new to rails (I actually come from the .net world, but I’ve been meaning to expand for some time now) I’m trying to create a user registration page (just getting my feet wet really) and I’ve h…

---

## [AR query question](https://www.ruby-forum.com/t/ar-query-question/186615)

<div class="topic-metadata">

**Author:** [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Replies:** 3\
**Last updated:** [April 10, 2010, 2:56am UTC](https://www.ruby-forum.com/t/ar-query-question/186615 "2010-04-10T02:56:42Z")

</div>

Here’s how my associations map: class Journal \< ActiveRecord::Base has\_many :music\_journal\_entries has\_many :film\_journal\_entries end class FilmJournalEntry \< ActiveRecord::Base belongs\_to :journal end class Musi…

---

## [Increment attribute while SHOW](https://www.ruby-forum.com/t/increment-attribute-while-show/186627)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 4\
**Last updated:** [April 10, 2010, 2:47am UTC](https://www.ruby-forum.com/t/increment-attribute-while-show/186627 "2010-04-10T02:47:20Z")

</div>

hi, im trying to do: def show @advisor = Advisor.find(params\[:id\]) @advisor.reviews = @advisor.reviews + 1 #reviews is just an integer @advisor.save! … how can i implement a “show”-counter? thx

---

## [Migration error](https://www.ruby-forum.com/t/migration-error/186624)

<div class="topic-metadata">

**Author:** [@bluegreen](https://www.ruby-forum.com/u/bluegreen)\
**Replies:** 3\
**Last updated:** [April 9, 2010, 11:34pm UTC](https://www.ruby-forum.com/t/migration-error/186624 "2010-04-09T23:34:40Z")

</div>

Hi, there. I got an error when I ran the migration to add a filed to database. In the migration file, def self.up change\_table :contents do |t| t.add\_string :new\_names end end def self.down change\_table :conten…

---

## [Metaprogramming, define\_method, and class\_eval issues](https://www.ruby-forum.com/t/metaprogramming-define-method-and-class-eval-issues/186581)

<div class="topic-metadata">

**Author:** [@klochner](https://www.ruby-forum.com/u/klochner)\
**Replies:** 2\
**Last updated:** [April 9, 2010, 8:31pm UTC](https://www.ruby-forum.com/t/metaprogramming-define-method-and-class-eval-issues/186581 "2010-04-09T20:31:59Z")

</div>

I have a 2-part question here that’s a little tricky and starting to make my head hurt. I’m working on a plugin for personal use, where I have an rclients table (not named clients because of conflicts with another plu…

---

## [Vestal Versions Related Records](https://www.ruby-forum.com/t/vestal-versions-related-records/186608)

<div class="topic-metadata">

**Author:** [@mikej](https://www.ruby-forum.com/u/mikej)\
**Replies:** 2\
**Last updated:** [April 9, 2010, 8:18pm UTC](https://www.ruby-forum.com/t/vestal-versions-related-records/186608 "2010-04-09T20:18:31Z")

</div>

I need to keep version of a model Client: has\_many :product\_clients has\_many :products, :through =\> :product\_clients The question is what is the best way of saving versions of the association. Can I make the associa…

---

## [Dinamic layout](https://www.ruby-forum.com/t/dinamic-layout/186611)

<div class="topic-metadata">

**Author:** [@CiriusMex](https://www.ruby-forum.com/u/CiriusMex)\
**Replies:** 3\
**Last updated:** [April 9, 2010, 7:40pm UTC](https://www.ruby-forum.com/t/dinamic-layout/186611 "2010-04-09T19:40:25Z")

</div>

Hello, I am developing a RubyOnRails application and need to apply a layout dinamically to my controllers. The thing is I have 2 diferent layouts and, in function of a parameters retreived from the database when the p…

---

## [Haml issue](https://www.ruby-forum.com/t/haml-issue/186571)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 4\
**Last updated:** [April 9, 2010, 7:14pm UTC](https://www.ruby-forum.com/t/haml-issue/186571 "2010-04-09T19:14:40Z")

</div>

Anyone know what’s wrong with this haml that it’s not displaying a chart (= @chart)? %table.body-layout %tr %td{:colspan =\> 2} .panel#students-chart %h3.header Students #…

---

## [Call Action on button Click](https://www.ruby-forum.com/t/call-action-on-button-click/186570)

<div class="topic-metadata">

**Author:** [@Ashwin\_V](https://www.ruby-forum.com/u/Ashwin_V)\
**Replies:** 3\
**Last updated:** [April 9, 2010, 6:26pm UTC](https://www.ruby-forum.com/t/call-action-on-button-click/186570 "2010-04-09T18:26:38Z")

</div>

Very simple question. How do i have just a simple button without a form , which calls an action on Click. Ashwin

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

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