# Rails

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

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

---

## [Send\_file with temporary files -- how to delete file after sending?](https://www.ruby-forum.com/t/send-file-with-temporary-files-how-to-delete-file-after-sending/193634)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 9:41pm UTC](https://www.ruby-forum.com/t/send-file-with-temporary-files-how-to-delete-file-after-sending/193634 "2010-08-20T21:41:54Z")

</div>

I’m looking for a way to stream temporary files and make sure they are deleted after they are sent. With Mongrel I can do something like this Tempfile.open(‘ue-basket-’) do |zip| Zip::ZipOutputStream.open(zip.path) d…

---

## [\[ruby\]Glassfish+warbler](https://www.ruby-forum.com/t/ruby-glassfish-warbler/193633)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 1\
**Last updated:** [August 20, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/ruby-glassfish-warbler/193633 "2010-08-20T21:17:54Z")

</div>

Hi folks!!! When, i deploy my app at glassfish, i’m getting some missing errors in the vendor/plugins folder, its like they never been there. Someone have been through this?

---

## [Gem location problem from rake task](https://www.ruby-forum.com/t/gem-location-problem-from-rake-task/193629)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 1\
**Last updated:** [August 20, 2010, 9:08pm UTC](https://www.ruby-forum.com/t/gem-location-problem-from-rake-task/193629 "2010-08-20T21:08:12Z")

</div>

I have installed the following gem which is in my environment.rb. However when I try to run a rake task, it gives the error: environment.rb config.gem “devise\_invitable”, :version =\> ‘0.2.3’ $ rake mytasks:task (in …

---

## [Help: find with except or only attributes](https://www.ruby-forum.com/t/help-find-with-except-or-only-attributes/193628)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/help-find-with-except-or-only-attributes/193628 "2010-08-20T20:46:51Z")

</div>

hi, is there a way of returning not all columns when doin a find? i know u can do that eg with the to\_xml(:only=\> …, :except=\> … but how would i do that with html? thx

---

## [\<% form\_for(@adv, :url =\> {:action=\>'create'}) do |f| %\>](https://www.ruby-forum.com/t/form-for-adv-url-action-create-do-f/193623)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/form-for-adv-url-action-create-do-f/193623 "2010-08-20T19:41:04Z")

</div>

I’m following an example in the “Head First Rails” book, but just changed @ad to @adv. Regarding the following in “new.html.erb”: \<% form\_for(@adv, :url =\> {:action=\>‘create’}) do |f| %\> I just want to confirm if I’m…

---

## [CSV with fastercsv](https://www.ruby-forum.com/t/csv-with-fastercsv/193605)

<div class="topic-metadata">

**Author:** [@ciri22](https://www.ruby-forum.com/u/ciri22)\
**Replies:** 8\
**Last updated:** [August 20, 2010, 7:25pm UTC](https://www.ruby-forum.com/t/csv-with-fastercsv/193605 "2010-08-20T19:25:29Z")

</div>

I am creating a csv file with fastercsv. require ‘fastercsv’ FasterCSV.open(“file.csv”, “w”) do |csv| csv \<\< \[45678, 45678, “stringa”\] end I would also print the last cell in quotation marks. Is there anyone who ca…

---

## [Failing in getaddrinfo in net/http framework](https://www.ruby-forum.com/t/failing-in-getaddrinfo-in-net-http-framework/193618)

<div class="topic-metadata">

**Author:** [@joshua](https://www.ruby-forum.com/u/joshua)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 5:43pm UTC](https://www.ruby-forum.com/t/failing-in-getaddrinfo-in-net-http-framework/193618 "2010-08-20T17:43:04Z")

</div>

Hello, I’m hitting a frustrating issue with my most recent rails application deployment. It’s running on an OSX 10.6.4 server, with ruby 1.8.7 (2010-08-16 patchlevel 302) \[i686-darwin10.4.0\], and rails 2.3.8. It’s an…

---

## [Routing Error](https://www.ruby-forum.com/t/routing-error/193612)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 3\
**Last updated:** [August 20, 2010, 5:08pm UTC](https://www.ruby-forum.com/t/routing-error/193612 "2010-08-20T17:08:30Z")

</div>

Hi! I deployed my app in my shared hosting. If I open dispatch.fcgi, i get this error: Routing Error No route matches “/public/dispatch.fcgi” with {:method=\>:get} Before this app works fine in localhost. Whats wrong…

---

## [Rails 3 flash message problems](https://www.ruby-forum.com/t/rails-3-flash-message-problems/193397)

<div class="topic-metadata">

**Author:** [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Replies:** 3\
**Last updated:** [August 20, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/rails-3-flash-message-problems/193397 "2010-08-20T16:59:43Z")

</div>

The following code in my application\_helper.rb class either eats the flash message or escapes it and does not display properly: Outputs the corresponding flash message if any are set def flash\_messages messages = \[\] …

---

## [Why through and foreign\_key not working?](https://www.ruby-forum.com/t/why-through-and-foreign-key-not-working/193532)

<div class="topic-metadata">

**Author:** [@mimosa](https://www.ruby-forum.com/u/mimosa)\
**Replies:** 5\
**Last updated:** [August 20, 2010, 4:48pm UTC](https://www.ruby-forum.com/t/why-through-and-foreign-key-not-working/193532 "2010-08-20T16:48:35Z")

</div>

I need SQL : SELECT activities.\* FROM activities INNER JOIN friendships ON activities.user\_id = friendships.friend\_id WHERE friendships.user\_id = 1 My User Model code: has\_many :friendships, :dependent =\> :destroy …

---

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

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 4\
**Last updated:** [August 20, 2010, 4:34pm UTC](https://www.ruby-forum.com/t/routes-ordering/193614 "2010-08-20T16:34:55Z")

</div>

In the “Head First Rails” book, it mentions this ordering in routes.rb: ActionController: : Routing: : Routes. draw do | map| map. connect ’ /ads/new’ , : controller=\>’ ads’ , : action=\>’ new’ map. connect ’ /ads/crea…

---

## [Configure create database virtual rails](https://www.ruby-forum.com/t/configure-create-database-virtual-rails/193579)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [August 20, 2010, 4:32pm UTC](https://www.ruby-forum.com/t/configure-create-database-virtual-rails/193579 "2010-08-20T16:32:54Z")

</div>

I have installed virtual machine and virtual rails on my laptop using Linux mint. Im learning as I go. Everything I need comes with this package : MySQL Mongrel Ruby1.8.7 Mongo D.B. Git 1.6.3.3 Netbeans 6.8 so…

---

## [Depreciation warning when running a db migrate!](https://www.ruby-forum.com/t/depreciation-warning-when-running-a-db-migrate/193570)

<div class="topic-metadata">

**Author:** [@jakx12](https://www.ruby-forum.com/u/jakx12)\
**Replies:** 6\
**Last updated:** [August 20, 2010, 1:59pm UTC](https://www.ruby-forum.com/t/depreciation-warning-when-running-a-db-migrate/193570 "2010-08-20T13:59:26Z")

</div>

Hey, Whenever i try and run a db migrate i get this error: DEPRECATION WARNING: Rake tasks in vendor/plugins/livevalidation/tasks and vendor/plugins/restful-authentication/tasks are deprecated. Use lib/tasks instead.…

---

## [Problem with db:create](https://www.ruby-forum.com/t/problem-with-db-create/193608)

<div class="topic-metadata">

**Author:** [@upabibi](https://www.ruby-forum.com/u/upabibi)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/problem-with-db-create/193608 "2010-08-20T13:30:40Z")

</div>

My ruby app always created the databases on postgres just fine, but, a days ago, I’ve tried to create a new project and when I execute the command “db:create:all” i got the following error: Couldn’t create database fo…

---

## [Strange error message in erb template](https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600)

<div class="topic-metadata">

**Author:** [@trapper](https://www.ruby-forum.com/u/trapper)\
**Replies:** 2\
**Last updated:** [August 20, 2010, 12:02pm UTC](https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600 "2010-08-20T12:02:47Z")

</div>

My erb template looks like this: \<% for f in @finders do %\> … \<%debugger%\> \<%= emitActionLinks(f, edit\_finder\_path(f), f.owner != 0) %\> \<% end %\> emitActionLinks is defined in application\_helper.rb and retur…

---

## [Re:HTTP download](https://www.ruby-forum.com/t/re-http-download/193598)

<div class="topic-metadata">

**Author:** [@Srinidhi](https://www.ruby-forum.com/u/Srinidhi)\
**Replies:** 1\
**Last updated:** [August 20, 2010, 11:30am UTC](https://www.ruby-forum.com/t/re-http-download/193598 "2010-08-20T11:30:43Z")

</div>

The application i am working requires me to upload and download a any type of file. I am using net:HTTP for upload part. The code looks somethijng like this. This works perfectly fine. uri = URI.parse($URL) http = Ne…

---

## [\[ann\]vtd-xml 2.9](https://www.ruby-forum.com/t/ann-vtd-xml-2-9/193599)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 11:03am UTC](https://www.ruby-forum.com/t/ann-vtd-xml-2-9/193599 "2010-08-20T11:03:12Z")

</div>

VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud computing, has been released. Please visit VTD-XML: The Future of XML Processing - Browse Files at SourceForge.net to download the latest version. …

---

## [Spelling error on rubyonrails.org](https://www.ruby-forum.com/t/spelling-error-on-rubyonrails-org/193597)

<div class="topic-metadata">

**Author:** [@Joel\_Cox](https://www.ruby-forum.com/u/Joel_Cox)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 11:02am UTC](https://www.ruby-forum.com/t/spelling-error-on-rubyonrails-org/193597 "2010-08-20T11:02:37Z")

</div>

On rubyonrails.org/applications, Urban Dictionary is described this way: “Define your slag.” Yes, slag. Sorry if there’s some other contact method I should have used for this, but I couldn’t find it.

---

## [FYI: Text::Box Feature Fixed in Prawn](https://www.ruby-forum.com/t/fyi-text-box-feature-fixed-in-prawn/193595)

<div class="topic-metadata">

**Author:** [@ceekays](https://www.ruby-forum.com/u/ceekays)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 9:28am UTC](https://www.ruby-forum.com/t/fyi-text-box-feature-fixed-in-prawn/193595 "2010-08-20T09:28:21Z")

</div>

Rails Riders, For those who like “prawning PDF docs to their RoR apps” : Text::Box has been patched to default the text-box height in stretchy boxes to the distance to the bottom of the page if no height is supplied …

---

## [Country state city drop down list rails](https://www.ruby-forum.com/t/country-state-city-drop-down-list-rails/193589)

<div class="topic-metadata">

**Author:** [@ashu](https://www.ruby-forum.com/u/ashu)\
**Replies:** 5\
**Last updated:** [August 20, 2010, 8:43am UTC](https://www.ruby-forum.com/t/country-state-city-drop-down-list-rails/193589 "2010-08-20T08:43:17Z")

</div>

hi every one please tell me the recommended way to get country state city drop down list in rails any gem - plug-in tutorial thanks in advance.

---

## [Plugin to update twitter status](https://www.ruby-forum.com/t/plugin-to-update-twitter-status/192433)

<div class="topic-metadata">

**Author:** [@stephanwehner](https://www.ruby-forum.com/u/stephanwehner)\
**Replies:** 1\
**Last updated:** [August 20, 2010, 8:21am UTC](https://www.ruby-forum.com/t/plugin-to-update-twitter-status/192433 "2010-08-20T08:21:36Z")

</div>

Just uploaded version 0.1 of a Ruby on Rails plugin “simple\_twitter\_post” to github: GitHub - stephan-buckmaster/simple\_twitter\_post: Ruby on Rails plugin to post status updates to twitter Makes it easy to update the…

---

## [Scriptaculous effect not working](https://www.ruby-forum.com/t/scriptaculous-effect-not-working/193584)

<div class="topic-metadata">

**Author:** [@jakx12](https://www.ruby-forum.com/u/jakx12)\
**Replies:** 0\
**Last updated:** [August 20, 2010, 2:30am UTC](https://www.ruby-forum.com/t/scriptaculous-effect-not-working/193584 "2010-08-20T02:30:20Z")

</div>

Hey so here is my code: \<% if @error == true %\> \<%= javascript\_tag “New Effect.Shake(‘form\_holder’); return false;” %\> \<% end %\> I know that the scriptaculous library is being included in the head of my view, but fo…

---

## [Rails3 console : how to get actual sql statements](https://www.ruby-forum.com/t/rails3-console-how-to-get-actual-sql-statements/187906)

<div class="topic-metadata">

**Author:** [@Nadal](https://www.ruby-forum.com/u/Nadal)\
**Replies:** 3\
**Last updated:** [August 20, 2010, 12:09am UTC](https://www.ruby-forum.com/t/rails3-console-how-to-get-actual-sql-statements/187906 "2010-08-20T00:09:57Z")

</div>

In rails 2.3.5 world I get to see all the sql statements on my console. Thanks to following line of code in my ~/.irbc if ENV\[‘RAILS\_ENV’\] Object.const\_set(:RAILS\_DEFAULT\_LOGGER, Logger.new(STDOUT)) end However abov…

---

## [How to perform "most viewed"](https://www.ruby-forum.com/t/how-to-perform-most-viewed/193571)

<div class="topic-metadata">

**Author:** [@nirosh](https://www.ruby-forum.com/u/nirosh)\
**Replies:** 12\
**Last updated:** [August 19, 2010, 11:41pm UTC](https://www.ruby-forum.com/t/how-to-perform-most-viewed/193571 "2010-08-19T23:41:04Z")

</div>

i have a poem model. i need to display the most viewed poems. is there any plug inns out there to do this? -nirosh-

---

## [Rails - Devise - Warden and InvalidAuthenticityToken](https://www.ruby-forum.com/t/rails-devise-warden-and-invalidauthenticitytoken/193577)

<div class="topic-metadata">

**Author:** [@Ruby\_on\_RailsS\_Talk](https://www.ruby-forum.com/u/Ruby_on_RailsS_Talk)\
**Replies:** 0\
**Last updated:** [August 19, 2010, 10:42pm UTC](https://www.ruby-forum.com/t/rails-devise-warden-and-invalidauthenticitytoken/193577 "2010-08-19T22:42:42Z")

</div>

Hi I’ve just uploaded my new website to my server and, after a couple of teething problems, seem to be hitting problems when I am using devise and warden to authenticate users etc. The following is the error message …

---

## [Postgres, concurrency, and rails](https://www.ruby-forum.com/t/postgres-concurrency-and-rails/193560)

<div class="topic-metadata">

**Author:** [@zbrod](https://www.ruby-forum.com/u/zbrod)\
**Replies:** 4\
**Last updated:** [August 19, 2010, 10:34pm UTC](https://www.ruby-forum.com/t/postgres-concurrency-and-rails/193560 "2010-08-19T22:34:50Z")

</div>

I work on a fairly large website that uses Ruby 1.8.6 and Rails 1.2.3. We cannot upgrade as it will hopelessly break our code. We are working on a new version in Java but for the next year at least we are stuck with t…

---

## [Composite primary keys and :joins=\>](https://www.ruby-forum.com/t/composite-primary-keys-and-joins/193529)

<div class="topic-metadata">

**Author:** [@JeffV](https://www.ruby-forum.com/u/JeffV)\
**Replies:** 1\
**Last updated:** [August 19, 2010, 9:59pm UTC](https://www.ruby-forum.com/t/composite-primary-keys-and-joins/193529 "2010-08-19T21:59:57Z")

</div>

I have a legacy db with the following simplified structure: Table-A: type\_key, code\_key, name, … # PKs are type\_key and code\_key, there is no id col and I cannot alter this db Table-B: # each row has only the code a…

---

## [Limiting scope of :validates\_uniqueness\_of](https://www.ruby-forum.com/t/limiting-scope-of-validates-uniqueness-of/193557)

<div class="topic-metadata">

**Author:** [@closedbook](https://www.ruby-forum.com/u/closedbook)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/limiting-scope-of-validates-uniqueness-of/193557 "2010-08-19T21:30:22Z")

</div>

I’m having a hard time limiting the scope of new comments to the Post model. So, for validates\_uniqueness\_of :title in the comment.rb model, that uniqueness would only be attached to the post I’m commenting to, not gl…

---

## [Adding new variables to a model](https://www.ruby-forum.com/t/adding-new-variables-to-a-model/193572)

<div class="topic-metadata">

**Author:** [@Madison\_K](https://www.ruby-forum.com/u/Madison_K)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 9:24pm UTC](https://www.ruby-forum.com/t/adding-new-variables-to-a-model/193572 "2010-08-19T21:24:47Z")

</div>

Hello – Thanks in advance for putting up with a newbie question:) I added two columns to my Products model. The db migration completed without error, I added the items to the views, and I tested the expected behavio…

---

## [Form\_for](https://www.ruby-forum.com/t/form-for/193272)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 5\
**Last updated:** [August 19, 2010, 9:16pm UTC](https://www.ruby-forum.com/t/form-for/193272 "2010-08-19T21:16:00Z")

</div>

At the following: Getting Started with Rails — Ruby on Rails Guides Under: 7.4 Generating a Controller It mentions the following: \<%= form\_for(\[@post, @post.comments.build\]) do |f| %\> Now, this is what I know: form\_…

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

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