# Rails

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

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

---

## [Activerecord get next element](https://www.ruby-forum.com/t/activerecord-get-next-element/175994)

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 9\
**Last updated:** [September 23, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/activerecord-get-next-element/175994 "2009-09-23T18:20:53Z")

</div>

Hi, How would you get an SQL element, the next one and the previous one, but the definition of a next/previous element is not dependant only of his id but also of a status, exemple : id status 1 true 2 false 3 t…

---

## [How to truncate tables before seeding data?](https://www.ruby-forum.com/t/how-to-truncate-tables-before-seeding-data/175896)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 5\
**Last updated:** [September 23, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/how-to-truncate-tables-before-seeding-data/175896 "2009-09-23T17:50:57Z")

</div>

Hey, I started recently using seed.rb which I find really cool but there’s something I haven’t figured out yet. Seeding is apparently for seeding data but now I’m kinda playing around with it and it keeps adding data …

---

## [Running Ror application from Tomcat](https://www.ruby-forum.com/t/running-ror-application-from-tomcat/176012)

<div class="topic-metadata">

**Author:** [@ialuronico](https://www.ruby-forum.com/u/ialuronico)\
**Replies:** 0\
**Last updated:** [September 23, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/running-ror-application-from-tomcat/176012 "2009-09-23T17:50:32Z")

</div>

We just did it by following this step-by-step guide http://adams.id.au/blog/2008/05/running-a-rails-app-under-tomcat-using-jruby/ if anyone was waiting for a hint I can say that this guide it worked for me.

---

## [Determine type in polymorphic relation](https://www.ruby-forum.com/t/determine-type-in-polymorphic-relation/175905)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 4\
**Last updated:** [September 23, 2009, 5:47pm UTC](https://www.ruby-forum.com/t/determine-type-in-polymorphic-relation/175905 "2009-09-23T17:47:10Z")

</div>

Hey, I’ve got a polymorphic relation and would like to create an object. How is it possible to determine whether its a ‘car’ or a ‘truck’? A person can owe cars and trucks. I could pass params like the car/truck id t…

---

## [Solved "Client does not support authentication protocol.."](https://www.ruby-forum.com/t/solved-client-does-not-support-authentication-protocol/176011)

<div class="topic-metadata">

**Author:** [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Replies:** 0\
**Last updated:** [September 23, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/solved-client-does-not-support-authentication-protocol/176011 "2009-09-23T17:31:45Z")

</div>

I decide to new post because I posted with MySQL title which dont say nothing about the real problem So when i get the message "Client does not support authentication protocol requested by server; consider upgrading…

---

## [RJS file not rendering](https://www.ruby-forum.com/t/rjs-file-not-rendering/175915)

<div class="topic-metadata">

**Author:** [@aaronvb](https://www.ruby-forum.com/u/aaronvb)\
**Replies:** 3\
**Last updated:** [September 23, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/rjs-file-not-rendering/175915 "2009-09-23T17:31:05Z")

</div>

Hi there, I’ve done this before many times. But for some reason, my controller isn’t rendering my RJS file. Here’s the setup: In the View: a call to remote\_function: \<select name="state" onchange="\<%= remote\_functi…

---

## [Failed validation not showing the errors but vars](https://www.ruby-forum.com/t/failed-validation-not-showing-the-errors-but-vars/176008)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 0\
**Last updated:** [September 23, 2009, 5:14pm UTC](https://www.ruby-forum.com/t/failed-validation-not-showing-the-errors-but-vars/176008 "2009-09-23T17:14:32Z")

</div>

Hello, I have a remote\_form\_for and got a strange validation error: ############################### Konnte dieses new activity Objekt nicht speichern: 2 Fehler. Bitte Ã¼berprÃ¼fen Sie die folgenden Felder: \* {{attri…

---

## [Set Time.zone from offset including DST](https://www.ruby-forum.com/t/set-time-zone-from-offset-including-dst/175992)

<div class="topic-metadata">

**Author:** [@florent](https://www.ruby-forum.com/u/florent)\
**Replies:** 6\
**Last updated:** [September 23, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/set-time-zone-from-offset-including-dst/175992 "2009-09-23T16:34:53Z")

</div>

Hi all, I have a big deal with timezones: is it possible to set a user’s timezone from it’s offset from UTC? I mean, I don’t want to ask the user in which timezone he is, so I get this offset from a Javascript call …

---

## [Forcing a "wait"](https://www.ruby-forum.com/t/forcing-a-wait/175999)

<div class="topic-metadata">

**Author:** [@RVince](https://www.ruby-forum.com/u/RVince)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 3:21pm UTC](https://www.ruby-forum.com/t/forcing-a-wait/175999 "2009-09-23T15:21:08Z")

</div>

I have something in my controller which needs to wait 1 or 2 seconds before doing a “render …” Is there a means in Ruby where I can make things wait by x seconds or milliseconds before continuing processing a request?…

---

## [Import excel / csv files](https://www.ruby-forum.com/t/import-excel-csv-files/175891)

<div class="topic-metadata">

**Author:** [@andkjaer](https://www.ruby-forum.com/u/andkjaer)\
**Replies:** 6\
**Last updated:** [September 23, 2009, 3:16pm UTC](https://www.ruby-forum.com/t/import-excel-csv-files/175891 "2009-09-23T15:16:26Z")

</div>

Hey, What way is the best to do imports of CSV files?

---

## [Collection\_Select](https://www.ruby-forum.com/t/collection-select/175990)

<div class="topic-metadata">

**Author:** [@Rails\_ROR](https://www.ruby-forum.com/u/Rails_ROR)\
**Replies:** 1\
**Last updated:** [September 23, 2009, 3:02pm UTC](https://www.ruby-forum.com/t/collection-select/175990 "2009-09-23T15:02:09Z")

</div>

HI Perhaps it is the most simple doubt that i am asking you all. I am really new to rails. I haven’t understood much about collection\_select. I have posts and author tables. I want the authors in posts. I need a c…

---

## [Retrieving subject line from a mail](https://www.ruby-forum.com/t/retrieving-subject-line-from-a-mail/175981)

<div class="topic-metadata">

**Author:** [@Rails\_ROR](https://www.ruby-forum.com/u/Rails_ROR)\
**Replies:** 3\
**Last updated:** [September 23, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/retrieving-subject-line-from-a-mail/175981 "2009-09-23T14:21:24Z")

</div>

Hi I want to retrieve the subject line received from the inbox in a mail either from yahoo, gmail, etc. Please guide me on this if anybody can. How do i proceed? Please let me know that. Thanks in advance. Regard…

---

## [Dynamic content inside a view - how to do](https://www.ruby-forum.com/t/dynamic-content-inside-a-view-how-to-do/175998)

<div class="topic-metadata">

**Author:** [@sameera](https://www.ruby-forum.com/u/sameera)\
**Replies:** 0\
**Last updated:** [September 23, 2009, 2:19pm UTC](https://www.ruby-forum.com/t/dynamic-content-inside-a-view-how-to-do/175998 "2009-09-23T14:19:09Z")

</div>

Hi, I have a program where customer can make different conditions (sales promotions), I dont want to create view for each promotion for customers to choose. What I thought of is, if I could save a given promotion’s v…

---

## [Collection\_text onchange event](https://www.ruby-forum.com/t/collection-text-onchange-event/175984)

<div class="topic-metadata">

**Author:** [@subashinikumar](https://www.ruby-forum.com/u/subashinikumar)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 2:02pm UTC](https://www.ruby-forum.com/t/collection-text-onchange-event/175984 "2009-09-23T14:02:58Z")

</div>

hi, I want to display a drop down list and when i select some option from the drop down list i want to display all the records under that selected category in the “SAME PAGE”… eg … \<%= collection\_select(:question,:s…

---

## [Migration Datatypes](https://www.ruby-forum.com/t/migration-datatypes/175993)

<div class="topic-metadata">

**Author:** [@Jonas\_L](https://www.ruby-forum.com/u/Jonas_L)\
**Replies:** 1\
**Last updated:** [September 23, 2009, 1:15pm UTC](https://www.ruby-forum.com/t/migration-datatypes/175993 "2009-09-23T13:15:51Z")

</div>

Hi, I am new to Rails and want to know where i can find a list of migration fieldtypes to use inside a scaffold command. Yours sincerely Jonas L.

---

## [Page rendering and drop down onchange event](https://www.ruby-forum.com/t/page-rendering-and-drop-down-onchange-event/175986)

<div class="topic-metadata">

**Author:** [@subashinikumar](https://www.ruby-forum.com/u/subashinikumar)\
**Replies:** 0\
**Last updated:** [September 23, 2009, 11:54am UTC](https://www.ruby-forum.com/t/page-rendering-and-drop-down-onchange-event/175986 "2009-09-23T11:54:15Z")

</div>

hi, I want to display a subject drop down list and when i select some option from the drop down list i want to display all the questions under that selected category in the “SAME PAGE” and also get a form to add new…

---

## [How it works](https://www.ruby-forum.com/t/how-it-works/175982)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 1\
**Last updated:** [September 23, 2009, 11:33am UTC](https://www.ruby-forum.com/t/how-it-works/175982 "2009-09-23T11:33:59Z")

</div>

def list #------- gets params\[:start\] from account-grid.js start = (params\[:start\] || 0).to\_i gets params\[:limit\] from account-grid.js #size variable has count per page size = (params\[:limit\] || 20).to\_i page variab…

---

## [Installing RedCloth](https://www.ruby-forum.com/t/installing-redcloth/175834)

<div class="topic-metadata">

**Author:** [@Davo](https://www.ruby-forum.com/u/Davo)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 9:30am UTC](https://www.ruby-forum.com/t/installing-redcloth/175834 "2009-09-23T09:30:27Z")

</div>

Hi All, I’m working through a book which touches on Textile for formating in the body of a blog. The procedure is: Add this line to environment.rb config.gem “RedCloth”, :version =\> “\>= 3.301”, :source =\> “http:// …

---

## [How to convert months into days in ruby?](https://www.ruby-forum.com/t/how-to-convert-months-into-days-in-ruby/175974)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 3\
**Last updated:** [September 23, 2009, 9:11am UTC](https://www.ruby-forum.com/t/how-to-convert-months-into-days-in-ruby/175974 "2009-09-23T09:11:54Z")

</div>

Hello, How to convert months to days in ruby? I want for example 6 months = total days of next 6 months from todays date. How i do that? Thanks, Vikas

---

## [Validation fails but objects seems to have the values](https://www.ruby-forum.com/t/validation-fails-but-objects-seems-to-have-the-values/175818)

<div class="topic-metadata">

**Author:** [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 8:53am UTC](https://www.ruby-forum.com/t/validation-fails-but-objects-seems-to-have-the-values/175818 "2009-09-23T08:53:33Z")

</div>

Hello everyone i am trying to save a nested model but it will always fail because 2 fields are missing I tried to examine what happens so i print the object to yaml, here s what i got: &id001 !ruby/object:Contract …

---

## [Random retrieveal from database](https://www.ruby-forum.com/t/random-retrieveal-from-database/175972)

<div class="topic-metadata">

**Author:** [@subashinikumar](https://www.ruby-forum.com/u/subashinikumar)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 8:31am UTC](https://www.ruby-forum.com/t/random-retrieveal-from-database/175972 "2009-09-23T08:31:54Z")

</div>

How can i choose some “n” (n is gonna be fixed )records randomly from a mysql database table from our controller? – Subashini kumar

---

## [For crontab](https://www.ruby-forum.com/t/for-crontab/175771)

<div class="topic-metadata">

**Author:** [@preksha](https://www.ruby-forum.com/u/preksha)\
**Replies:** 20\
**Last updated:** [September 23, 2009, 7:24am UTC](https://www.ruby-forum.com/t/for-crontab/175771 "2009-09-23T07:24:00Z")

</div>

hi all, i haven’t used cron yet but now i want to use it and got some idea about cron from google but not exactly… so i want to use cron in ruby on rails application. in application i want to fire some query everyday…

---

## [How to see HTTP requests as they are received?](https://www.ruby-forum.com/t/how-to-see-http-requests-as-they-are-received/175962)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 5:36am UTC](https://www.ruby-forum.com/t/how-to-see-http-requests-as-they-are-received/175962 "2009-09-23T05:36:50Z")

</div>

Hello Experts! I am debugging a problem with one of my controllers in my development environment and I would like to see the actual HTTP request as it comes in. Is there some option or configuration file for mongrel …

---

## [App Setting, Where To Put: environment.rb, initializer.rb, lib..?](https://www.ruby-forum.com/t/app-setting-where-to-put-environment-rb-initializer-rb-lib/175959)

<div class="topic-metadata">

**Author:** [@MaggotChild](https://www.ruby-forum.com/u/MaggotChild)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 5:34am UTC](https://www.ruby-forum.com/t/app-setting-where-to-put-environment-rb-initializer-rb-lib/175959 "2009-09-23T05:34:29Z")

</div>

I have a path that my model (Audio) uses to r/w files. This path differs between production, test, and dev. Audio includes a module that overrides some ActiveRecord methods. This module is contained in config/initial…

---

## [Dexagogo Really Easy Field Validation](https://www.ruby-forum.com/t/dexagogo-really-easy-field-validation/175963)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [September 23, 2009, 5:11am UTC](https://www.ruby-forum.com/t/dexagogo-really-easy-field-validation/175963 "2009-09-23T05:11:04Z")

</div>

Hi guys, I’m trying to use Dexagogo’s Really Easy Field validation for my project http://tetlaw.id.au/view/javascript/really-easy-field-validation and I’m having trouble getting it to work on two seperate forms. I ha…

---

## [Decompose ActiveRecord script into methods](https://www.ruby-forum.com/t/decompose-activerecord-script-into-methods/175964)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 1\
**Last updated:** [September 23, 2009, 5:06am UTC](https://www.ruby-forum.com/t/decompose-activerecord-script-into-methods/175964 "2009-09-23T05:06:58Z")

</div>

If I commend out the def and end lines for the “all” method, the script runs fine. However, the goal is to decompose the script into several methods, which fails with: thufir@ARRAKIS:~/projects/aggregator$ thufir@AR…

---

## [How to check whether AJAX request or not](https://www.ruby-forum.com/t/how-to-check-whether-ajax-request-or-not/175776)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 4\
**Last updated:** [September 23, 2009, 5:03am UTC](https://www.ruby-forum.com/t/how-to-check-whether-ajax-request-or-not/175776 "2009-09-23T05:03:27Z")

</div>

Hello, I don’t really know how to solve following problem: When I access …/users/1 I get the website and the user is shown properly, all good. I have some link\_to\_remote actions on my website and when they call the /…

---

## [RE: We're sorry something went wrong when I use -d mysql](https://www.ruby-forum.com/t/re-were-sorry-something-went-wrong-when-i-use-d-mysql/175944)

<div class="topic-metadata">

**Author:** [@about2flip](https://www.ruby-forum.com/u/about2flip)\
**Replies:** 3\
**Last updated:** [September 23, 2009, 4:05am UTC](https://www.ruby-forum.com/t/re-were-sorry-something-went-wrong-when-i-use-d-mysql/175944 "2009-09-23T04:05:28Z")

</div>

Hi: I am trying to make an application using mysql. When I do rails name – d mysql, and then run mongrel. I will go to localhost:3000 and when i check my application environment, I get an error We’re sorry something …

---

## [Google Table Problem](https://www.ruby-forum.com/t/google-table-problem/175888)

<div class="topic-metadata">

**Author:** [@chaithu\_krishna](https://www.ruby-forum.com/u/chaithu_krishna)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 3:29am UTC](https://www.ruby-forum.com/t/google-table-problem/175888 "2009-09-23T03:29:10Z")

</div>

Google Table is returning Error in some views and the same code is not returning the table in some views and not even showing the error messages.

---

## [? Buttonless?](https://www.ruby-forum.com/t/buttonless/175904)

<div class="topic-metadata">

**Author:** [@Dudebot](https://www.ruby-forum.com/u/Dudebot)\
**Replies:** 8\
**Last updated:** [September 23, 2009, 3:18am UTC](https://www.ruby-forum.com/t/buttonless/175904 "2009-09-23T03:18:36Z")

</div>

I have this code, which is working quite well: \<% form\_tag ‘’, :method =\> ‘GET’ do %\> \<%= radio\_button\_tag :report, 'by\_date', params\[ :report \] ||= 'by\_date' %\>By Date \<%= radio\_button\_tag :report, 'by\_donor', …

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

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