# Rails

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

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

---

## [Dynamic Loading of Configuration From Database](https://www.ruby-forum.com/t/dynamic-loading-of-configuration-from-database/132860)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 9:04am UTC](https://www.ruby-forum.com/t/dynamic-loading-of-configuration-from-database/132860 "2008-03-31T09:04:20Z")

</div>

Hi All, I am looking at dynamically loading configuration of rails app depending on a flag that is being passed to the app through the HTTP header. The config is stored in a database table. Depending on the value rece…

---

## [Date - how many days until](https://www.ruby-forum.com/t/date-how-many-days-until/133125)

<div class="topic-metadata">

**Author:** [@jimmypalmer](https://www.ruby-forum.com/u/jimmypalmer)\
**Replies:** 2\
**Last updated:** [March 31, 2008, 8:46am UTC](https://www.ruby-forum.com/t/date-how-many-days-until/133125 "2008-03-31T08:46:45Z")

</div>

Given a date I need to find out how many days until that date. for example if I am given march 29 and today is march 27 how would I return 2 days? I need to verify this in the controller and distance\_of\_time\_in\_words …

---

## [How to execute javascript after redirect?](https://www.ruby-forum.com/t/how-to-execute-javascript-after-redirect/133172)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 8:37am UTC](https://www.ruby-forum.com/t/how-to-execute-javascript-after-redirect/133172 "2008-03-31T08:37:11Z")

</div>

Hi, I’ve got a form with create and preview buttons - both point to create action, but if create button was pressed, user is redirected to show action, if preview was pressed user is redirected to edit action. After …

---

## [Action Mailer Problem with salted hash login generator](https://www.ruby-forum.com/t/action-mailer-problem-with-salted-hash-login-generator/133399)

<div class="topic-metadata">

**Author:** [@MrSBless](https://www.ruby-forum.com/u/MrSBless)\
**Replies:** 0\
**Last updated:** [March 31, 2008, 8:35am UTC](https://www.ruby-forum.com/t/action-mailer-problem-with-salted-hash-login-generator/133399 "2008-03-31T08:35:22Z")

</div>

Hi! Guys I am using the salted hash login generator for login purpose. Now, I am working in friendship. When I want to request someone for friendship request via the action mailer I get following error: Due to changes…

---

## [Ip2location How to integrate](https://www.ruby-forum.com/t/ip2location-how-to-integrate/133398)

<div class="topic-metadata">

**Author:** [@amjithps](https://www.ruby-forum.com/u/amjithps)\
**Replies:** 0\
**Last updated:** [March 31, 2008, 8:27am UTC](https://www.ruby-forum.com/t/ip2location-how-to-integrate/133398 "2008-03-31T08:27:45Z")

</div>

Hi everyone. Good Morning., Do anyone know how to integrate ip2location code in Ruby on Rails project. Please visit the Links for details. They have Ruby code works with some C module. I am finding little difficu…

---

## [How can i create 2 foreign key in a table referring key from one table?](https://www.ruby-forum.com/t/how-can-i-create-2-foreign-key-in-a-table-referring-key-from-one-table/117726)

<div class="topic-metadata">

**Author:** [@Amjith](https://www.ruby-forum.com/u/Amjith)\
**Replies:** 2\
**Last updated:** [March 31, 2008, 8:24am UTC](https://www.ruby-forum.com/t/how-can-i-create-2-foreign-key-in-a-table-referring-key-from-one-table/117726 "2008-03-31T08:24:28Z")

</div>

hi Friends, i have a accounts table and a transaction table see the schema below acc\_master acc\_id int(11) – primary key acc\_name cur\_balance regist\_date update\_date acc\_trans trans\_id – primary key t…

---

## [If statement help please](https://www.ruby-forum.com/t/if-statement-help-please/133283)

<div class="topic-metadata">

**Author:** [@megax](https://www.ruby-forum.com/u/megax)\
**Replies:** 3\
**Last updated:** [March 31, 2008, 8:17am UTC](https://www.ruby-forum.com/t/if-statement-help-please/133283 "2008-03-31T08:17:39Z")

</div>

Hi I have created a page were users can make a rating for a product and add this to a database, but when they do this the correct way teh item name is moved to the rating page and used in a text box. I want to secure…

---

## [Problem during the friendship model](https://www.ruby-forum.com/t/problem-during-the-friendship-model/133396)

<div class="topic-metadata">

**Author:** [@jagdishSRubin](https://www.ruby-forum.com/u/jagdishSRubin)\
**Replies:** 0\
**Last updated:** [March 31, 2008, 8:08am UTC](https://www.ruby-forum.com/t/problem-during-the-friendship-model/133396 "2008-03-31T08:08:42Z")

</div>

Hi all, In my project I have to build a friendship model. So I followed as in the RailsSpace Book. I have used Salted\_hash\_login generator as a login authentication. Now after I build the friendship model, I have got…

---

## [Routes and IDs above 9](https://www.ruby-forum.com/t/routes-and-ids-above-9/133378)

<div class="topic-metadata">

**Author:** [@Mozmonkey](https://www.ruby-forum.com/u/Mozmonkey)\
**Replies:** 2\
**Last updated:** [March 31, 2008, 7:54am UTC](https://www.ruby-forum.com/t/routes-and-ids-above-9/133378 "2008-03-31T07:54:37Z")

</div>

I feel really silly right now but can’t get past a weird error: user\_update\_url failed to generate from {:controller=\>“users”, :id=\>10, :action=\>“update”}, expected: {:controller=\>“users”, :action=\>“update”}, diff: {:…

---

## [How do I create globally available resources?](https://www.ruby-forum.com/t/how-do-i-create-globally-available-resources/133279)

<div class="topic-metadata">

**Author:** [@M\_P](https://www.ruby-forum.com/u/M_P)\
**Replies:** 3\
**Last updated:** [March 31, 2008, 7:47am UTC](https://www.ruby-forum.com/t/how-do-i-create-globally-available-resources/133279 "2008-03-31T07:47:34Z")

</div>

Hello, I want to initialize a giant hash on application startup, and have a controller interact with that hash WITHOUT having to rebuild the hash for every single request. Generating the hash will be a bit time consu…

---

## [Checking request.post? before action](https://www.ruby-forum.com/t/checking-request-post-before-action/133390)

<div class="topic-metadata">

**Author:** [@teck](https://www.ruby-forum.com/u/teck)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 7:17am UTC](https://www.ruby-forum.com/t/checking-request-post-before-action/133390 "2008-03-31T07:17:04Z")

</div>

I have the following code: def create redirect\_to :action =\> “index” unless request.post? @entry = Entry.new(params\[:entry\]) if @entry.save flash\[:notice\] = “Successfully created…” redirect\_to :action =\> “index” e…

---

## [Smiley Parser](https://www.ruby-forum.com/t/smiley-parser/133211)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 13\
**Last updated:** [March 31, 2008, 7:00am UTC](https://www.ruby-forum.com/t/smiley-parser/133211 "2008-03-31T07:00:36Z")

</div>

Hi, Does anyone know of smiley parser - that can parse for standard smileys { :), :frowning: etc } and replace with images? I also wanted URL parser that can automagically give hyperlinks to URLs. Any inputs? PS: h…

---

## [What is the server load when uploading files?](https://www.ruby-forum.com/t/what-is-the-server-load-when-uploading-files/133276)

<div class="topic-metadata">

**Author:** [@sumwutdum](https://www.ruby-forum.com/u/sumwutdum)\
**Replies:** 4\
**Last updated:** [March 31, 2008, 6:43am UTC](https://www.ruby-forum.com/t/what-is-the-server-load-when-uploading-files/133276 "2008-03-31T06:43:35Z")

</div>

It isn’t a secret that Rails doesn’t handle uploads in the best possible way, but what are the limits of this? I have a site that on a typical post will contain 5- 10 picture uploads each of which will have a size of …

---

## [Primary key?](https://www.ruby-forum.com/t/primary-key/133265)

<div class="topic-metadata">

**Author:** [@rashantha](https://www.ruby-forum.com/u/rashantha)\
**Replies:** 3\
**Last updated:** [March 31, 2008, 6:41am UTC](https://www.ruby-forum.com/t/primary-key/133265 "2008-03-31T06:41:49Z")

</div>

can you use 2 pirmary keys. the standard user\_id key exists but i would also like to use another key for my links. i am not sure how to implement this. also i don’t want any auto incrementing of this second primary ke…

---

## [Max file size](https://www.ruby-forum.com/t/max-file-size/133385)

<div class="topic-metadata">

**Author:** [@jimmypalmer](https://www.ruby-forum.com/u/jimmypalmer)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 5:25am UTC](https://www.ruby-forum.com/t/max-file-size/133385 "2008-03-31T05:25:33Z")

</div>

Does rails have a max file size that is allows to be uploaded?

---

## [Can anyone help me withTimeout error in rails 2.0.2](https://www.ruby-forum.com/t/can-anyone-help-me-withtimeout-error-in-rails-2-0-2/133340)

<div class="topic-metadata">

**Author:** [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 5:03am UTC](https://www.ruby-forum.com/t/can-anyone-help-me-withtimeout-error-in-rails-2-0-2/133340 "2008-03-31T05:03:52Z")

</div>

Hello, I have been trying since long to send a mail thorough rails… Previously when I had rails version 1.2.5 the sending mails worked fine. But now when i try to send a mail in rails 2.0.2 I always get timeout error…

---

## [Define size of text\_field\_with\_auto\_complete](https://www.ruby-forum.com/t/define-size-of-text-field-with-auto-complete/133346)

<div class="topic-metadata">

**Author:** [@ncancelliere](https://www.ruby-forum.com/u/ncancelliere)\
**Replies:** 4\
**Last updated:** [March 31, 2008, 4:35am UTC](https://www.ruby-forum.com/t/define-size-of-text-field-with-auto-complete/133346 "2008-03-31T04:35:32Z")

</div>

I am using the auto\_complete plugin to help out in some of my forms in Rails 2.0. The issue I’m having is trying to get the text field size to be more than 30 in width in the display. It seems to be taking the defaul…

---

## [Rake Migrate Syntax Error](https://www.ruby-forum.com/t/rake-migrate-syntax-error/133370)

<div class="topic-metadata">

**Author:** [@pikminknight](https://www.ruby-forum.com/u/pikminknight)\
**Replies:** 7\
**Last updated:** [March 31, 2008, 4:28am UTC](https://www.ruby-forum.com/t/rake-migrate-syntax-error/133370 "2008-03-31T04:28:48Z")

</div>

When in Terminal on Mac OS X, I get this syntax error when I run the “rake migrate” command: rake migrate --trace (in /Users/dillon/Documents/rails/expenses/expenses) \*\* Invoke migrate (first\_time) \*\* Invoke db:migr…

---

## [Mcsi lida..2](https://www.ruby-forum.com/t/mcsi-lida-2/133366)

<div class="topic-metadata">

**Author:** [@mehala](https://www.ruby-forum.com/u/mehala)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 2:24am UTC](https://www.ruby-forum.com/t/mcsi-lida-2/133366 "2008-03-31T02:24:12Z")

</div>

mcsi lida… http://megajavn.blogspot.com/ http://megajavn.blogspot.com/2008/03/dna.html http://megajavn.blogspot.com/2008/03/structure-of-double-stranded-dna.h tml

---

## [Conventions/Model](https://www.ruby-forum.com/t/conventions-model/133377)

<div class="topic-metadata">

**Author:** [@corywilkerson](https://www.ruby-forum.com/u/corywilkerson)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 2:10am UTC](https://www.ruby-forum.com/t/conventions-model/133377 "2008-03-31T02:10:09Z")

</div>

All, I’ve read about twelve different articles and I’ve yet to find a consistent solution to my conundrum. I have a ‘people’ table and an associated ‘person’ model object. I have a ‘preferences’ table and an associat…

---

## [Unit tests and application.rb](https://www.ruby-forum.com/t/unit-tests-and-application-rb/133353)

<div class="topic-metadata">

**Author:** [@ma6rl](https://www.ruby-forum.com/u/ma6rl)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 2:09am UTC](https://www.ruby-forum.com/t/unit-tests-and-application-rb/133353 "2008-03-31T02:09:34Z")

</div>

Am fairly new to Rails so this may be an obvious question but I would appreciate any help I can get. I am working on an existing application and trying to add some unit tests (there aren’t any tests to date). Firstly…

---

## [Cannot execute migrate to postgresql from Win XP](https://www.ruby-forum.com/t/cannot-execute-migrate-to-postgresql-from-win-xp/133371)

<div class="topic-metadata">

**Author:** [@saikumar67](https://www.ruby-forum.com/u/saikumar67)\
**Replies:** 1\
**Last updated:** [March 31, 2008, 2:04am UTC](https://www.ruby-forum.com/t/cannot-execute-migrate-to-postgresql-from-win-xp/133371 "2008-03-31T02:04:16Z")

</div>

Hai to all I am totally new to ‘Ruby on Rails’. During the course of an attempt to migrate to a postgresql 8.0 ( WinXP ), had the following problem. I am using Netbeans 6.0 IDE \*\* Invoke db:migrate (first\_time) \*\* …

---

## [How to get data using JOINS or include](https://www.ruby-forum.com/t/how-to-get-data-using-joins-or-include/133379)

<div class="topic-metadata">

**Author:** [@jordelver](https://www.ruby-forum.com/u/jordelver)\
**Replies:** 0\
**Last updated:** [March 31, 2008, 1:51am UTC](https://www.ruby-forum.com/t/how-to-get-data-using-joins-or-include/133379 "2008-03-31T01:51:22Z")

</div>

Hi, I’m having trouble getting the records I need from ActiveRecord. I have a category model which is using acts\_as\_tree. I have two levels of categories currently. So, I have something like this: Main Category 1 |…

---

## [Bignums, integers and migrations](https://www.ruby-forum.com/t/bignums-integers-and-migrations/133362)

<div class="topic-metadata">

**Author:** [@gustav](https://www.ruby-forum.com/u/gustav)\
**Replies:** 3\
**Last updated:** [March 31, 2008, 1:12am UTC](https://www.ruby-forum.com/t/bignums-integers-and-migrations/133362 "2008-03-31T01:12:05Z")

</div>

Hi. I’m using a migration to extract data from one table, to another. In the process I also convert ip-adresses to integers, for insertion in the new table. Problem is that migrations doesn’t seem to handle large numb…

---

## [Best Praktice for Translation](https://www.ruby-forum.com/t/best-praktice-for-translation/133365)

<div class="topic-metadata">

**Author:** [@fero46](https://www.ruby-forum.com/u/fero46)\
**Replies:** 0\
**Last updated:** [March 31, 2008, 12:06am UTC](https://www.ruby-forum.com/t/best-praktice-for-translation/133365 "2008-03-31T00:06:22Z")

</div>

Hi, I am searching for an easy way to make translation availibe on a website. I thought about a Mod

---

## [Conditional validation?](https://www.ruby-forum.com/t/conditional-validation/133356)

<div class="topic-metadata">

**Author:** [@drsharp](https://www.ruby-forum.com/u/drsharp)\
**Replies:** 2\
**Last updated:** [March 30, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/conditional-validation/133356 "2008-03-30T22:08:05Z")

</div>

Hi, I have followed the tutorial in the AWDWR book for uploading an image. This involves adding the following field to the form. \<%= f.file\_field :uploaded\_picture %\> The model then goes to work on the data to store …

---

## [Hmt problem](https://www.ruby-forum.com/t/hmt-problem/133352)

<div class="topic-metadata">

**Author:** [@musty](https://www.ruby-forum.com/u/musty)\
**Replies:** 2\
**Last updated:** [March 30, 2008, 10:07pm UTC](https://www.ruby-forum.com/t/hmt-problem/133352 "2008-03-30T22:07:40Z")

</div>

Hello…hope someone can help. I have a has\_many through relationship set up but am not able to get it to work properly. As you can see I have users, roles and a user\_roles table. To verify things are working I created …

---

## [Find by multiple optional fields](https://www.ruby-forum.com/t/find-by-multiple-optional-fields/133355)

<div class="topic-metadata">

**Author:** [@ptb](https://www.ruby-forum.com/u/ptb)\
**Replies:** 1\
**Last updated:** [March 30, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/find-by-multiple-optional-fields/133355 "2008-03-30T21:43:18Z")

</div>

My application has several search fields. Each field is optional and if they are all left blank, I return some reasonable results. If the fields were simply conditional I could add each search term to a hash then pa…

---

## [Resources: allow two http verbs for custom action](https://www.ruby-forum.com/t/resources-allow-two-http-verbs-for-custom-action/133357)

<div class="topic-metadata">

**Author:** [@schaf88](https://www.ruby-forum.com/u/schaf88)\
**Replies:** 0\
**Last updated:** [March 30, 2008, 9:13pm UTC](https://www.ruby-forum.com/t/resources-allow-two-http-verbs-for-custom-action/133357 "2008-03-30T21:13:08Z")

</div>

Hi! I have a very simple question: if I define a custom action on a resource, for example through map.resources :projects, :member =\> {:foobar =\> :get} how can I allow get AND delete http verbs? thanks Flo Schaf

---

## [A little confused about threads and VM's](https://www.ruby-forum.com/t/a-little-confused-about-threads-and-vms/133324)

<div class="topic-metadata">

**Author:** [@ron](https://www.ruby-forum.com/u/ron)\
**Replies:** 3\
**Last updated:** [March 30, 2008, 8:54pm UTC](https://www.ruby-forum.com/t/a-little-confused-about-threads-and-vms/133324 "2008-03-30T20:54:41Z")

</div>

Hi, I’m researching how Ruby works with threads. Could someone help with what a “green” thread is and a native thread? Also, what is the relationship between these threads, Rails and the VMs that have been (are bei…

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

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