# Rails

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

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

---

## [Execute cap deploy:migrations fails](https://www.ruby-forum.com/t/execute-cap-deploy-migrations-fails/160349)

<div class="topic-metadata">

**Author:** [@olivierntk](https://www.ruby-forum.com/u/olivierntk)\
**Replies:** 2\
**Last updated:** [February 15, 2009, 5:29am UTC](https://www.ruby-forum.com/t/execute-cap-deploy-migrations-fails/160349 "2009-02-15T05:29:29Z")

</div>

Hi there, I am trying to deploy a rails app on dreamhost. Here is the error message that I get: fatal: ‘home/USER\_NAME/DOMAIN\_NAME/git/APPLICATION\_NAME.git’: unable to chdir or not a git archive fatal: The remote end…

---

## [Association include and joins issues - 'Unknown Column' error](https://www.ruby-forum.com/t/association-include-and-joins-issues-unknown-column-error/160304)

<div class="topic-metadata">

**Author:** [@chris](https://www.ruby-forum.com/u/chris)\
**Replies:** 2\
**Last updated:** [February 15, 2009, 1:22am UTC](https://www.ruby-forum.com/t/association-include-and-joins-issues-unknown-column-error/160304 "2009-02-15T01:22:43Z")

</div>

Hi all, I’d really appreciate any help / advice on this problem. When I test this def edit @entity = Entity.find(params\[:id\], :include =\> :key\_factors) @traits = Trait.find :all, :include =\> :trait\_values, :joins…

---

## [Can this be done without using find\_by\_sql](https://www.ruby-forum.com/t/can-this-be-done-without-using-find-by-sql/160322)

<div class="topic-metadata">

**Author:** [@tonypm](https://www.ruby-forum.com/u/tonypm)\
**Replies:** 6\
**Last updated:** [February 15, 2009, 12:21am UTC](https://www.ruby-forum.com/t/can-this-be-done-without-using-find-by-sql/160322 "2009-02-15T00:21:48Z")

</div>

Hi, I am increasingly needing to do some more complex finds involving several table associations. I can usually find an SQL solution, but find it hard to think these out using ActiveRecord find techniques. I guess …

---

## [2 button\_to functions for file downloads](https://www.ruby-forum.com/t/2-button-to-functions-for-file-downloads/160137)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 7\
**Last updated:** [February 14, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/2-button-to-functions-for-file-downloads/160137 "2009-02-14T18:59:32Z")

</div>

I have 2 button\_to functions that download 2 different files. the first one acts like a submit and the second on actually does downlaod the file. Does anyone know what would cause that? \<%= button\_to ‘Download PCCIS…

---

## [How can I secure rails script?](https://www.ruby-forum.com/t/how-can-i-secure-rails-script/158102)

<div class="topic-metadata">

**Author:** [@bpx](https://www.ruby-forum.com/u/bpx)\
**Replies:** 1\
**Last updated:** [February 14, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/how-can-i-secure-rails-script/158102 "2009-02-14T17:12:46Z")

</div>

Hello, I was searching for some way to secure my rails scripts. Do anybody know what can I use? I found Rencoder (www.rencoder.com) on the net but I want to know if there are others programs I can use?

---

## [AR\_Mailer Problem](https://www.ruby-forum.com/t/ar-mailer-problem/160278)

<div class="topic-metadata">

**Author:** [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Replies:** 1\
**Last updated:** [February 14, 2009, 4:24pm UTC](https://www.ruby-forum.com/t/ar-mailer-problem/160278 "2009-02-14T16:24:48Z")

</div>

Hi all, I am using ar\_mailer for sending newsletter. I got mails queued in emails table. However when running ar\_sendmail to begin sending the mails, an exception is thrown: Unhandled exception wrong number of argume…

---

## [BackgroundRB persistant job table not created](https://www.ruby-forum.com/t/backgroundrb-persistant-job-table-not-created/160327)

<div class="topic-metadata">

**Author:** [@ratnavel](https://www.ruby-forum.com/u/ratnavel)\
**Replies:** 1\
**Last updated:** [February 14, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/backgroundrb-persistant-job-table-not-created/160327 "2009-02-14T15:54:46Z")

</div>

Hi, I have used backgroundrb plugin in my application, I followed the tutorial in, http://backgroundrb.rubyforge.org/ Everything works fine, When I run rake backgroundrb:setup, It created the required scripts, and …

---

## [How to stop validating after a failed validation?](https://www.ruby-forum.com/t/how-to-stop-validating-after-a-failed-validation/160300)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 2\
**Last updated:** [February 14, 2009, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-stop-validating-after-a-failed-validation/160300 "2009-02-14T13:16:37Z")

</div>

I want my first check to verify email address uniqueness. If this validation fails, there’s no reason to go further with validating the user’s input. I want a singular message displayed in this case. Is there a way…

---

## [Eager fetching returning JSON results](https://www.ruby-forum.com/t/eager-fetching-returning-json-results/160307)

<div class="topic-metadata">

**Author:** [@builtbysimple](https://www.ruby-forum.com/u/builtbysimple)\
**Replies:** 2\
**Last updated:** [February 14, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/eager-fetching-returning-json-results/160307 "2009-02-14T13:08:56Z")

</div>

All, I have a many\_to\_one relationship object between products and categories and I want to return the category too using JSON results but it seems that rails only gives back the products JSON object on the view laye…

---

## [Logging all exceptions](https://www.ruby-forum.com/t/logging-all-exceptions/160180)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [February 14, 2009, 11:52am UTC](https://www.ruby-forum.com/t/logging-all-exceptions/160180 "2009-02-14T11:52:11Z")

</div>

Hey everyody, what is the best way to log all exceptions that are thrown in my Rails application into a database table? I need some kind of hook in the Rails exception methods?! I already tried the Exception Logger p…

---

## [Observe Field Problem](https://www.ruby-forum.com/t/observe-field-problem/160302)

<div class="topic-metadata">

**Author:** [@enzor](https://www.ruby-forum.com/u/enzor)\
**Replies:** 1\
**Last updated:** [February 14, 2009, 11:32am UTC](https://www.ruby-forum.com/t/observe-field-problem/160302 "2009-02-14T11:32:52Z")

</div>

Hi there! I need to use observe field to change dynamically one select field based on another select field: here is the view: \<%= observe\_field ‘class’, :url =\> { :action =\> ‘update\_list’ }, :frequency =\> 0.25, :up…

---

## [Params](https://www.ruby-forum.com/t/params/160313)

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 1\
**Last updated:** [February 14, 2009, 11:18am UTC](https://www.ruby-forum.com/t/params/160313 "2009-02-14T11:18:47Z")

</div>

How to convert params variable as hash.I am not able to convert params as a hash.

---

## [Odd js behavior in Chrome & Safari](https://www.ruby-forum.com/t/odd-js-behavior-in-chrome-safari/156316)

<div class="topic-metadata">

**Author:** [@kenwei](https://www.ruby-forum.com/u/kenwei)\
**Replies:** 5\
**Last updated:** [February 14, 2009, 11:13am UTC](https://www.ruby-forum.com/t/odd-js-behavior-in-chrome-safari/156316 "2009-02-14T11:13:32Z")

</div>

View file has a js function “confirm\_result()” in section: The section has Works just fine in IE7 and FireFox3. But not in Chrome 1 or Safari 3. In the latter two the confirm box appears, then a new blank page wi…

---

## [Newbie question](https://www.ruby-forum.com/t/newbie-question/160288)

<div class="topic-metadata">

**Author:** [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Replies:** 4\
**Last updated:** [February 14, 2009, 11:13am UTC](https://www.ruby-forum.com/t/newbie-question/160288 "2009-02-14T11:13:32Z")

</div>

Hey all, I’ve been working with rails for a grand total of 8 hours, and have run up against the first problem I haven’t been able to adequately solve using google. So I’ve got a schema that basically consists of a bu…

---

## [How to set the selected option for a combo box?](https://www.ruby-forum.com/t/how-to-set-the-selected-option-for-a-combo-box/160319)

<div class="topic-metadata">

**Author:** [@csaba](https://www.ruby-forum.com/u/csaba)\
**Replies:** 0\
**Last updated:** [February 14, 2009, 11:13am UTC](https://www.ruby-forum.com/t/how-to-set-the-selected-option-for-a-combo-box/160319 "2009-02-14T11:13:31Z")

</div>

Kategorie \<% @selected\_category = Category.find(:first, :select =\> "name, id", :conditions =\> \["id = ?", params\['category\_id'\]\]) %\> \<% @all\_categories = Category.find(:all, :order …

---

## [Help with return\_back](https://www.ruby-forum.com/t/help-with-return-back/160294)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 1\
**Last updated:** [February 14, 2009, 9:16am UTC](https://www.ruby-forum.com/t/help-with-return-back/160294 "2009-02-14T09:16:57Z")

</div>

I have to log in my app, after the login I want to return back to the page I was visiting just before the redirect to the login. Now, I have this in my Sessions controller: redirect\_back\_or\_default(’/’)

---

## [Format text in forums (enter, bold,...)](https://www.ruby-forum.com/t/format-text-in-forums-enter-bold/160289)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 3\
**Last updated:** [February 14, 2009, 8:24am UTC](https://www.ruby-forum.com/t/format-text-in-forums-enter-bold/160289 "2009-02-14T08:24:55Z")

</div>

I have forums in my web. I have a field in my database in my posts table that is a textarea. I would like to save things like press enter or use bold when I write a message in the forum, but it is not possible only wi…

---

## [Which is the best way for comparing dates?](https://www.ruby-forum.com/t/which-is-the-best-way-for-comparing-dates/160290)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 3\
**Last updated:** [February 14, 2009, 8:24am UTC](https://www.ruby-forum.com/t/which-is-the-best-way-for-comparing-dates/160290 "2009-02-14T08:24:19Z")

</div>

Is it correct to do this? if @date\_a \> @date\_b puts ‘hi’ end

---

## [Parms variable](https://www.ruby-forum.com/t/parms-variable/160311)

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 0\
**Last updated:** [February 14, 2009, 7:35am UTC](https://www.ruby-forum.com/t/parms-variable/160311 "2009-02-14T07:35:35Z")

</div>

I have doutes on params variable in rails. How to convert params to hash in rails.

---

## [Favored development environment](https://www.ruby-forum.com/t/favored-development-environment/159865)

<div class="topic-metadata">

**Author:** [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Replies:** 7\
**Last updated:** [February 14, 2009, 4:50am UTC](https://www.ruby-forum.com/t/favored-development-environment/159865 "2009-02-14T04:50:56Z")

</div>

I am about to purchase a laptop strictly for development (ruby & rails) and then leverage my existing large screen monitor with it when in the office. Laptop monitor for running tests, large screen for development et…

---

## [Fetcher with MMS2R throwing socket error](https://www.ruby-forum.com/t/fetcher-with-mms2r-throwing-socket-error/159064)

<div class="topic-metadata">

**Author:** [@adeel](https://www.ruby-forum.com/u/adeel)\
**Replies:** 1\
**Last updated:** [February 13, 2009, 10:29pm UTC](https://www.ruby-forum.com/t/fetcher-with-mms2r-throwing-socket-error/159064 "2009-02-13T22:29:41Z")

</div>

Hi I’m using Fetcher with MMS2R as described in the Peepcode mini- book. After I start Fetcher I get the following error a few seconds later: $ RAILS\_ENV=development ruby script/mail\_fetcher start Starting MailFetche…

---

## [Fetcher Daemon Questions - receive?](https://www.ruby-forum.com/t/fetcher-daemon-questions-receive/122271)

<div class="topic-metadata">

**Author:** [@dandiebolt](https://www.ruby-forum.com/u/dandiebolt)\
**Replies:** 1\
**Last updated:** [February 13, 2009, 10:26pm UTC](https://www.ruby-forum.com/t/fetcher-daemon-questions-receive/122271 "2009-02-13T22:26:40Z")

</div>

I’m starting to play with Slantwise.com’s Fetcher to process emails via a Ruby script. Here’s the basic code lifted from their plugin: class MailFetcherDaemon \< Daemon::Base @config = YAML.load\_file("#{RAILS\_ROOT}/…

---

## [Number formatter](https://www.ruby-forum.com/t/number-formatter/110564)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 16\
**Last updated:** [February 13, 2009, 10:19pm UTC](https://www.ruby-forum.com/t/number-formatter/110564 "2009-02-13T22:19:37Z")

</div>

Hi, Does anyone know if the reverse of the rails 20.kilobytes (megabytes/ gigabytes etc.) exists? I have lots of values in my model that are stored as bytes and I’d like to easily convert them to a MB or GB approxima…

---

## [Storing user specific settings](https://www.ruby-forum.com/t/storing-user-specific-settings/160291)

<div class="topic-metadata">

**Author:** [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Replies:** 2\
**Last updated:** [February 13, 2009, 8:55pm UTC](https://www.ruby-forum.com/t/storing-user-specific-settings/160291 "2009-02-13T20:55:03Z")

</div>

I need to store user specific settings in database. Which is a better approach storing them in one row with each column for each setting Table columns in these case would be id, user\_id, setting 1, setting 2, setting…

---

## [Classic pagination with custom finders/sql](https://www.ruby-forum.com/t/classic-pagination-with-custom-finders-sql/160206)

<div class="topic-metadata">

**Author:** [@balla123](https://www.ruby-forum.com/u/balla123)\
**Replies:** 1\
**Last updated:** [February 13, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/classic-pagination-with-custom-finders-sql/160206 "2009-02-13T20:52:05Z")

</div>

Say I have a user model with the following def active find(:all, :conditions =\> {:state =\> ‘active’}) end How can I get this working with classic pagination in my controller without duplicating my “logic” for findin…

---

## [Background Processing for CSV Exports of data](https://www.ruby-forum.com/t/background-processing-for-csv-exports-of-data/160287)

<div class="topic-metadata">

**Author:** [@JimCifarelli](https://www.ruby-forum.com/u/JimCifarelli)\
**Replies:** 0\
**Last updated:** [February 13, 2009, 7:02pm UTC](https://www.ruby-forum.com/t/background-processing-for-csv-exports-of-data/160287 "2009-02-13T19:02:54Z")

</div>

Hello Everyone, I’d like to provide a page where the user can click to export some data as a csv file. It would be great to have the page show a progress value for percent complete on generating the file (file gener…

---

## [Render js from another controller](https://www.ruby-forum.com/t/render-js-from-another-controller/160255)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 2\
**Last updated:** [February 13, 2009, 6:19pm UTC](https://www.ruby-forum.com/t/render-js-from-another-controller/160255 "2009-02-13T18:19:43Z")

</div>

Hi all, In my GamesController I try to render create\_or\_update.js that is stored in the events view dir. Apparently Rails alwayslooks in the games view dir. Is there a way I can force Rails to look in the events view…

---

## [Regarding REST](https://www.ruby-forum.com/t/regarding-rest/160239)

<div class="topic-metadata">

**Author:** [@chaitanya](https://www.ruby-forum.com/u/chaitanya)\
**Replies:** 2\
**Last updated:** [February 13, 2009, 5:57pm UTC](https://www.ruby-forum.com/t/regarding-rest/160239 "2009-02-13T17:57:56Z")

</div>

How to write routes.rb specification to add login.rhtml and register.rhtml files into my application.

---

## [Easy RoR \<-\> Javascript syntax question](https://www.ruby-forum.com/t/easy-ror-javascript-syntax-question/160186)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 4\
**Last updated:** [February 13, 2009, 5:53pm UTC](https://www.ruby-forum.com/t/easy-ror-javascript-syntax-question/160186 "2009-02-13T17:53:31Z")

</div>

Hi there, a simple n00b question: I have that Javascript snippet on my page (see below; taken from jquery, actually). I want to pass it the “@cities” array from the controller. But what’s the correct syntax, here? S…

---

## [How to get first 10 items from hash in ruby?](https://www.ruby-forum.com/t/how-to-get-first-10-items-from-hash-in-ruby/196896)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 4\
**Last updated:** [February 13, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/how-to-get-first-10-items-from-hash-in-ruby/196896 "2009-02-13T17:48:30Z")

</div>

Hello All, I am new to programming, i have little problem with hash. I want to retrieve first 10 items(key value pairs) from given hash{} hashTable = {“a” =\> 1, “b” =\> 5, “c” =\> 2, “d” =\> 6, “e” =\> 4, “f” =\> 7, “g” =\> …

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

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