# Rails

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

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

---

## [How cna I pop-up a dialog in a controller](https://www.ruby-forum.com/t/how-cna-i-pop-up-a-dialog-in-a-controller/158261)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 7\
**Last updated:** [January 22, 2009, 1:57am UTC](https://www.ruby-forum.com/t/how-cna-i-pop-up-a-dialog-in-a-controller/158261 "2009-01-22T01:57:07Z")

</div>

I want to pop-up a warning dialog in a controller. How can I do this?

---

## [How can I specify layout when using redirect\_to](https://www.ruby-forum.com/t/how-can-i-specify-layout-when-using-redirect-to/158182)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 4\
**Last updated:** [January 22, 2009, 1:44am UTC](https://www.ruby-forum.com/t/how-can-i-specify-layout-when-using-redirect-to/158182 "2009-01-22T01:44:12Z")

</div>

I use redirect\_to in this way: class AdminController \< ApplicationController def logout redirect\_to ({:controller=\>'builder', :action=\>'index'}) end end this code is in the controller “admin”. when this action is…

---

## [\[JOB\] Rails Developer, Los Angeles | 65-95k](https://www.ruby-forum.com/t/job-rails-developer-los-angeles-65-95k/158320)

<div class="topic-metadata">

**Author:** [@superiorss](https://www.ruby-forum.com/u/superiorss)\
**Replies:** 0\
**Last updated:** [January 22, 2009, 1:39am UTC](https://www.ruby-forum.com/t/job-rails-developer-los-angeles-65-95k/158320 "2009-01-22T01:39:15Z")

</div>

My Los A. client is seeking a full time, salaried, on-site Ruby on Rails Developer to work on a number of projects including streaming video services. If you are looking for an independent, agile team and love keeping…

---

## [Order by size desc](https://www.ruby-forum.com/t/order-by-size-desc/158302)

<div class="topic-metadata">

**Author:** [@perezda](https://www.ruby-forum.com/u/perezda)\
**Replies:** 2\
**Last updated:** [January 22, 2009, 12:57am UTC](https://www.ruby-forum.com/t/order-by-size-desc/158302 "2009-01-22T00:57:17Z")

</div>

ok so i am trying to order the results by the total size in a desc order, here is what i have so far and its not working def show @reports = Report.find(:all, :group =\> ‘user\_id’, :order =\> ‘user\_id.size desc’ ) end …

---

## [3 use case and the index method](https://www.ruby-forum.com/t/3-use-case-and-the-index-method/158281)

<div class="topic-metadata">

**Author:** [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Replies:** 13\
**Last updated:** [January 21, 2009, 11:57pm UTC](https://www.ruby-forum.com/t/3-use-case-and-the-index-method/158281 "2009-01-21T23:57:03Z")

</div>

I wrote the code below which doesn’t seem to work, but If I delete the last if statement, it does work, obviously for the first two use cases only. Is there a better way to write this code? In my routes file I have ma…

---

## [Customize page(s) based on a referring search query](https://www.ruby-forum.com/t/customize-page-s-based-on-a-referring-search-query/158308)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 0\
**Last updated:** [January 21, 2009, 10:23pm UTC](https://www.ruby-forum.com/t/customize-page-s-based-on-a-referring-search-query/158308 "2009-01-21T22:23:20Z")

</div>

Hi i want to customize a page based on a referring search query and i want to store the keyword(s) of the referring search query string in my app-database. Someone links for some direction how this works in RoR. rem…

---

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

<div class="topic-metadata">

**Author:** [@raimon](https://www.ruby-forum.com/u/raimon)\
**Replies:** 9\
**Last updated:** [January 21, 2009, 10:09pm UTC](https://www.ruby-forum.com/t/routes-question/158095 "2009-01-21T22:09:20Z")

</div>

Hello, I’m stucked in a completely newbie question … I have one controller scann all the default methods work: index, new, save, … I added a new one called query, and when I try to call it http://127.0.0.1:3000/scan…

---

## [Javascript\_include\_tag question](https://www.ruby-forum.com/t/javascript-include-tag-question/158289)

<div class="topic-metadata">

**Author:** [@alex](https://www.ruby-forum.com/u/alex)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 8:42pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-question/158289 "2009-01-21T20:42:26Z")

</div>

Hi all, I'm use google gears, i need to store my javascript files by manifest list. In my rails app, i used the helper method named javascript\_include\_tag like this: \<%= javascript\_include\_tag …

---

## [Retrieving Global Arrays](https://www.ruby-forum.com/t/retrieving-global-arrays/158298)

<div class="topic-metadata">

**Author:** [@Sav](https://www.ruby-forum.com/u/Sav)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/retrieving-global-arrays/158298 "2009-01-21T20:10:21Z")

</div>

I inherited an app that created STATES & COUNTRIES as global hashes in config/environment.rb STATES = {} STATES\[:AL\] = ‘Alabama’ STATES\[:AK\] = ‘Alaska’ STATES\[:AZ\] = ‘Arizona’ … I’m able to render the name correct…

---

## [How to update more than one div through form\_remote\_tag](https://www.ruby-forum.com/t/how-to-update-more-than-one-div-through-form-remote-tag/158286)

<div class="topic-metadata">

**Author:** [@sauravsuman012](https://www.ruby-forum.com/u/sauravsuman012)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 6:57pm UTC](https://www.ruby-forum.com/t/how-to-update-more-than-one-div-through-form-remote-tag/158286 "2009-01-21T18:57:06Z")

</div>

Hi All I have to update more than a single DIV through form\_remote\_tag . I am posting my code . In rhtml page \<%= form\_remote\_tag({:url=\>{:controller=\>‘image\_builders’, :action =\>‘image\_creation’}, :update =\>‘photo’, …

---

## [Memory leak in update from 2.1.2 to 2.2.2](https://www.ruby-forum.com/t/memory-leak-in-update-from-2-1-2-to-2-2-2/157498)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 4\
**Last updated:** [January 21, 2009, 6:38pm UTC](https://www.ruby-forum.com/t/memory-leak-in-update-from-2-1-2-to-2-2-2/157498 "2009-01-21T18:38:47Z")

</div>

My last deployment was based on Rails 2.1.2 and would run for months without restarts and without leaking memory; memory would sit at around 35 to 40M per Mongrel instance. On updating to 2.2.2 I’m seeing gradual memo…

---

## [Rake db:migrate and mysql](https://www.ruby-forum.com/t/rake-db-migrate-and-mysql/158236)

<div class="topic-metadata">

**Author:** [@rst](https://www.ruby-forum.com/u/rst)\
**Replies:** 2\
**Last updated:** [January 21, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-and-mysql/158236 "2009-01-21T18:04:51Z")

</div>

Hi, when I run this it aborts with an access denied message and usepassword = NO How do I change this to either not require a password, or allow me to set the password in the rake command line execution (it’s set in t…

---

## [How to refresh multiple DIV on a single Ajax Call](https://www.ruby-forum.com/t/how-to-refresh-multiple-div-on-a-single-ajax-call/158284)

<div class="topic-metadata">

**Author:** [@sauravsuman012](https://www.ruby-forum.com/u/sauravsuman012)\
**Replies:** 2\
**Last updated:** [January 21, 2009, 5:35pm UTC](https://www.ruby-forum.com/t/how-to-refresh-multiple-div-on-a-single-ajax-call/158284 "2009-01-21T17:35:09Z")

</div>

Hi all , I have to refresh three div in a single ajax call … Anybody having any Idea . Please let me help , It would be great for me. Thanks In Advance

---

## [Download a content as a pdf format](https://www.ruby-forum.com/t/download-a-content-as-a-pdf-format/158272)

<div class="topic-metadata">

**Author:** [@cool](https://www.ruby-forum.com/u/cool)\
**Replies:** 3\
**Last updated:** [January 21, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/download-a-content-as-a-pdf-format/158272 "2009-01-21T16:42:19Z")

</div>

Guys, i am displaying this content in the view WASC Visit 25 Feb We also will be making final preparations for our WASC Accreditation Team’s visit March 10, 11 and 12. They will be using the Old …

---

## [Passing object ids with link\_to\_remote](https://www.ruby-forum.com/t/passing-object-ids-with-link-to-remote/158282)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 0\
**Last updated:** [January 21, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/passing-object-ids-with-link-to-remote/158282 "2009-01-21T16:40:41Z")

</div>

When passing an array of objects in the :url part of link\_to\_remote like so: link\_to\_remote “Edit”, :url =\> {:action =\> “test”, :appts =\> @objects} the params\[:appts\] holds the id’s for all the objects in @objects. T…

---

## [AR to\_xml problem with associations, Builder::XmlMarkup#to\_a](https://www.ruby-forum.com/t/ar-to-xml-problem-with-associations-builder-xmlmarkup-to-a/158277)

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/ar-to-xml-problem-with-associations-builder-xmlmarkup-to-a/158277 "2009-01-21T16:20:29Z")

</div>

When I do a to\_xml(with a block) on an association of a model I got a Builder::XmlMarkup#to\_ary should return Array Example that does not work. @intervenant = Intervenant.find(params\[:id\]) output = @intervenant.to\_xm…

---

## [How can I "DRYize" this method?](https://www.ruby-forum.com/t/how-can-i-dryize-this-method/158276)

<div class="topic-metadata">

**Author:** [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Replies:** 3\
**Last updated:** [January 21, 2009, 4:06pm UTC](https://www.ruby-forum.com/t/how-can-i-dryize-this-method/158276 "2009-01-21T16:06:04Z")

</div>

Hi all, well I have this helper in my form, but it isn’t DRY, as you see: \<%= f.text\_field(:birth\_date, :size =\> ‘10’, :maxlength =\> ‘10’, :class =\> “format-d-m-y divider-slash split-date”, :value =\> (@person.birth\_d…

---

## [Install of in\_place\_editing not working](https://www.ruby-forum.com/t/install-of-in-place-editing-not-working/158273)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [January 21, 2009, 2:31pm UTC](https://www.ruby-forum.com/t/install-of-in-place-editing-not-working/158273 "2009-01-21T14:31:40Z")

</div>

I have recently upgraded by application to 2.2.2. In doing so, I have installed the plugin in\_place\_editing from github using: ruby script/plugin install git://github.com/rails/in\_place\_editing.git I now see an execu…

---

## [Assert\_select / assert\_tag issue](https://www.ruby-forum.com/t/assert-select-assert-tag-issue/124974)

<div class="topic-metadata">

**Author:** [@jimlast](https://www.ruby-forum.com/u/jimlast)\
**Replies:** 3\
**Last updated:** [January 21, 2009, 1:07pm UTC](https://www.ruby-forum.com/t/assert-select-assert-tag-issue/124974 "2009-01-21T13:07:26Z")

</div>

Upgraded to RoR 2.0 on Mac OS X - and cannot seem to get assert\_select or the supposedly deprecated assert\_tag to work. - Asserts are fairly simple and so is the page being tested - see below for HTML and different er…

---

## [Rails Table Relations questions](https://www.ruby-forum.com/t/rails-table-relations-questions/158266)

<div class="topic-metadata">

**Author:** [@sickboy](https://www.ruby-forum.com/u/sickboy)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 12:12pm UTC](https://www.ruby-forum.com/t/rails-table-relations-questions/158266 "2009-01-21T12:12:10Z")

</div>

Hello, I’m breaking my head atm about table relations / associations in Rails. The idea is this: Collections has many mods, mods have many folders, folders have many items. A collection can have many different versi…

---

## [Decrypting password](https://www.ruby-forum.com/t/decrypting-password/158206)

<div class="topic-metadata">

**Author:** [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Replies:** 6\
**Last updated:** [January 21, 2009, 11:01am UTC](https://www.ruby-forum.com/t/decrypting-password/158206 "2009-01-21T11:01:39Z")

</div>

Hi, I am using “Digest::SHA1.hexdigest” to encrypt password. Now, I want to decrypt that password. Is it possible to decrypt the password and recover original one? Thank, Tushar

---

## [Sumbitting a form to different controller](https://www.ruby-forum.com/t/sumbitting-a-form-to-different-controller/158262)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 8:47am UTC](https://www.ruby-forum.com/t/sumbitting-a-form-to-different-controller/158262 "2009-01-21T08:47:09Z")

</div>

for multi model projects which have their own controllers and views plus forms for editing and adding objects, how do you incorporate two different models forms in one view for example on a todo lists main hub (e.g. h…

---

## [Is it possible to pass a model name as a variable?](https://www.ruby-forum.com/t/is-it-possible-to-pass-a-model-name-as-a-variable/158263)

<div class="topic-metadata">

**Author:** [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Replies:** 3\
**Last updated:** [January 21, 2009, 8:42am UTC](https://www.ruby-forum.com/t/is-it-possible-to-pass-a-model-name-as-a-variable/158263 "2009-01-21T08:42:15Z")

</div>

Hi all, Is it possible to pass a model name as a variable? For example in controller there is a method like this, def list var = User.find(:all) end where in var we heve collected all data from users table. If i ed…

---

## [Having troubles saving a new model](https://www.ruby-forum.com/t/having-troubles-saving-a-new-model/158250)

<div class="topic-metadata">

**Author:** [@dazonic](https://www.ruby-forum.com/u/dazonic)\
**Replies:** 4\
**Last updated:** [January 21, 2009, 8:03am UTC](https://www.ruby-forum.com/t/having-troubles-saving-a-new-model/158250 "2009-01-21T08:03:34Z")

</div>

My model is being created but isn’t saving. It’s like it skips straight past saving. Any ideas why it might do this? Updating works fine. def create @volunteer = Volunteer.new(params\[:volunteer\]) @volunteer.save red…

---

## [ActionController::Base.send :include, etc](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 3\
**Last updated:** [January 21, 2009, 7:42am UTC](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091 "2009-01-21T07:42:40Z")

</div>

Hi In one of the method say require\_helpers i have the code helper\_constant = SomeHelper ActionController::Base.send :include, helper\_constant ActionView::Base.send :include, helper\_constant ActionView::Helpers::F…

---

## [Error in loading rails](https://www.ruby-forum.com/t/error-in-loading-rails/158209)

<div class="topic-metadata">

**Author:** [@gourav](https://www.ruby-forum.com/u/gourav)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 7:30am UTC](https://www.ruby-forum.com/t/error-in-loading-rails/158209 "2009-01-21T07:30:46Z")

</div>

Hi, I have checked out the clean code from production which is up and running. I am facing issue to get the rails application up and running on my development box. This is what I am trying: D:\\project\>rake db:create …

---

## [Problems with using gem (hpricot ) on shared hosting](https://www.ruby-forum.com/t/problems-with-using-gem-hpricot-on-shared-hosting/154862)

<div class="topic-metadata">

**Author:** [@jul1an](https://www.ruby-forum.com/u/jul1an)\
**Replies:** 2\
**Last updated:** [January 21, 2009, 6:35am UTC](https://www.ruby-forum.com/t/problems-with-using-gem-hpricot-on-shared-hosting/154862 "2009-01-21T06:35:46Z")

</div>

I get a shared web hosting from eleven2 They have a cpanel that let you install and update gems But i don’t know how to use them I used cpanel to update hpricot gem I found it installed in /ruby/gems/gems/hpricot-0.6…

---

## [Shared templates across controllers](https://www.ruby-forum.com/t/shared-templates-across-controllers/158232)

<div class="topic-metadata">

**Author:** [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Replies:** 4\
**Last updated:** [January 21, 2009, 6:26am UTC](https://www.ruby-forum.com/t/shared-templates-across-controllers/158232 "2009-01-21T06:26:25Z")

</div>

Hey all, Here’s my situation: I have a pair of controllers with associated models (called Services and Testimonials) that are quite similar. Because their CRUD behavior is executed via AJAX, the “templates” for the a…

---

## [Model update/create not saved to params\[\]](https://www.ruby-forum.com/t/model-update-create-not-saved-to-params/158188)

<div class="topic-metadata">

**Author:** [@gte351s](https://www.ruby-forum.com/u/gte351s)\
**Replies:** 1\
**Last updated:** [January 21, 2009, 4:45am UTC](https://www.ruby-forum.com/t/model-update-create-not-saved-to-params/158188 "2009-01-21T04:45:51Z")

</div>

I’m trying to build a form to create or update a model using remote call. When I submit the form, I see that the changes aren’t applied. I started the server with --debugger and noticed the params hash doesn’t receive…

---

## [Imbedding rails syntax in a text area](https://www.ruby-forum.com/t/imbedding-rails-syntax-in-a-text-area/158252)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 0\
**Last updated:** [January 21, 2009, 3:56am UTC](https://www.ruby-forum.com/t/imbedding-rails-syntax-in-a-text-area/158252 "2009-01-21T03:56:07Z")

</div>

I have the need to imbed some rails \<%%\> syntax in a text area. I want the person filling in the text area to be able to enter database extracted data when ever the page is displayed. This would be something like a us…

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

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