# Rails

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

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

---

## [Caching using ||=](https://www.ruby-forum.com/t/caching-using/119156)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 2\
**Last updated:** [November 4, 2007, 1:17am UTC](https://www.ruby-forum.com/t/caching-using/119156 "2007-11-04T01:17:41Z")

</div>

Hi all I’m a bit unsure about the caching with ||= … I have the following code class Member \< ActiveRecord::Base def allowed\_to?(right, model) # Setup owned system rights if not already done unless @owned\_system\_rig…

---

## [Birthdate validation](https://www.ruby-forum.com/t/birthdate-validation/119143)

<div class="topic-metadata">

**Author:** [@Thiago\_G](https://www.ruby-forum.com/u/Thiago_G)\
**Replies:** 3\
**Last updated:** [November 4, 2007, 12:07am UTC](https://www.ruby-forum.com/t/birthdate-validation/119143 "2007-11-04T00:07:23Z")

</div>

Hello everyone, I’m almost cracking my head trying to do this birthdate validation. It turns out that I can only accept users with at least 18 years old and I’m trying to validate it writing this code on my user.rb fi…

---

## [\[ANN\] CSV Importer for ActiveRecord](https://www.ruby-forum.com/t/ann-csv-importer-for-activerecord/110330)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 3\
**Last updated:** [November 3, 2007, 11:32pm UTC](https://www.ruby-forum.com/t/ann-csv-importer-for-activerecord/110330 "2007-11-03T23:32:18Z")

</div>

Hey all, Just thought I’d let you all know that I’ve posted a CSV importer plugin for Rails that adds an import method to ActiveRecord: http://www.stephenbartholomew.co.uk/2007/7/20/csv-importer-for-rails. It’s fairl…

---

## [Mysql output](https://www.ruby-forum.com/t/mysql-output/119142)

<div class="topic-metadata">

**Author:** [@jimmygoogle](https://www.ruby-forum.com/u/jimmygoogle)\
**Replies:** 1\
**Last updated:** [November 3, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/mysql-output/119142 "2007-11-03T23:01:18Z")

</div>

I have a textarea where the users enter a list items in varying formats. This is then inserted to my DB. When I look at the input in the DB the format is the same as the users enters it which is fine. so the input c…

---

## [How make utilities for models and controllers?](https://www.ruby-forum.com/t/how-make-utilities-for-models-and-controllers/119146)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 4\
**Last updated:** [November 3, 2007, 10:16pm UTC](https://www.ruby-forum.com/t/how-make-utilities-for-models-and-controllers/119146 "2007-11-03T22:16:12Z")

</div>

It’s me again. I need to abstract out some utilities that I want accessible to all controllers, AR models, and my own non-AR models. Adding methods to application.rb doesn’t do it – which I think I understand because…

---

## [RESTful dynamic select tags](https://www.ruby-forum.com/t/restful-dynamic-select-tags/119152)

<div class="topic-metadata">

**Author:** [@Pascal\_F](https://www.ruby-forum.com/u/Pascal_F)\
**Replies:** 0\
**Last updated:** [November 3, 2007, 9:28pm UTC](https://www.ruby-forum.com/t/restful-dynamic-select-tags/119152 "2007-11-03T21:28:49Z")

</div>

Hi there, i have a RESTful (hope so… it’s my first one :slight\_smile: ) app with a project model and a project controller. There is also a model timeblock which represents a specific amount of time a user spends work…

---

## [SQL Server Pagination code here if you need it](https://www.ruby-forum.com/t/sql-server-pagination-code-here-if-you-need-it/225975)

<div class="topic-metadata">

**Author:** [@surf](https://www.ruby-forum.com/u/surf)\
**Replies:** 0\
**Last updated:** [November 3, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/sql-server-pagination-code-here-if-you-need-it/225975 "2007-11-03T20:17:23Z")

</div>

Here is a SQL Server halfway decent working pagination I recently wrote. Out of the box Rails pagination was not working very well at all. I found little on the internet and thought if I could give something back to t…

---

## [How update model from within its own finder method?](https://www.ruby-forum.com/t/how-update-model-from-within-its-own-finder-method/119097)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 15\
**Last updated:** [November 3, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/how-update-model-from-within-its-own-finder-method/119097 "2007-11-03T18:54:22Z")

</div>

Wondering how I’d go about updating a model under this scenario which is authenticating a user, and updating the user record for tracking 3- strikes lockout. controller makes a call like this: @user = User.authentica…

---

## [Logout & deleting cookies](https://www.ruby-forum.com/t/logout-deleting-cookies/119110)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 4\
**Last updated:** [November 3, 2007, 6:36pm UTC](https://www.ruby-forum.com/t/logout-deleting-cookies/119110 "2007-11-03T18:36:14Z")

</div>

The logout strategy on page 172 of AWDWR doesn’t seem to do anything. I ended up creating the same thing on my own, then looked up how they did it in the book. I would expect it to update the session record to clear o…

---

## [Serving a FLV through rails](https://www.ruby-forum.com/t/serving-a-flv-through-rails/118957)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 7\
**Last updated:** [November 3, 2007, 6:20pm UTC](https://www.ruby-forum.com/t/serving-a-flv-through-rails/118957 "2007-11-03T18:20:28Z")

</div>

Hello list, The website I’m developing has many FLV-encoded videos as it’s main products. Currently I’m just throwing the FLVs in a public folder, however, the client would like more control over the serving of these…

---

## [Rails and REST](https://www.ruby-forum.com/t/rails-and-rest/119129)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 2\
**Last updated:** [November 3, 2007, 5:43pm UTC](https://www.ruby-forum.com/t/rails-and-rest/119129 "2007-11-03T17:43:26Z")

</div>

Hello, I was wondering how do I use the respond\_to xml ? class PeopleController \< ApplicationController def index @peope = People.find(:all) respond\_to do | request | request.html { } request.xml { render :xml =\> @…

---

## [Problem with form update and multiple submit](https://www.ruby-forum.com/t/problem-with-form-update-and-multiple-submit/119081)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [November 3, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/problem-with-form-update-and-multiple-submit/119081 "2007-11-03T17:18:17Z")

</div>

Here is what I am doing. I do a form\_remote\_tag in order to update my data. I want to be able to prevent the user from going back to the form with the browser back button, so by having it ajax after the submit finish…

---

## [File upload](https://www.ruby-forum.com/t/file-upload/119136)

<div class="topic-metadata">

**Author:** [@arnitak](https://www.ruby-forum.com/u/arnitak)\
**Replies:** 1\
**Last updated:** [November 3, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/file-upload/119136 "2007-11-03T16:44:53Z")

</div>

Hi I have trouble uploading files with RoR. I followed the examples into wiki and I always end up with a stringify\_keys! error. I just want to upload a simple file, however it does not work with the example presented…

---

## [Has\_many and the \<\< operator?](https://www.ruby-forum.com/t/has-many-and-the-operator/119098)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 6\
**Last updated:** [November 3, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/has-many-and-the-operator/119098 "2007-11-03T16:28:48Z")

</div>

In the AWDWR book it mentions that the \<\< operator (or method?) just adds the child model the child collection within the parent model. For some reason when I am using it it doesn’t work as expected. Here is what I ha…

---

## [Access the stack trace](https://www.ruby-forum.com/t/access-the-stack-trace/119134)

<div class="topic-metadata">

**Author:** [@miked](https://www.ruby-forum.com/u/miked)\
**Replies:** 0\
**Last updated:** [November 3, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/access-the-stack-trace/119134 "2007-11-03T16:28:06Z")

</div>

Hi: Don’t know if this the right title for what I’m looking for, but basically I want to be able to figure out what controller and actions are being fired. Let me describe specifically what I’m looking for: I have a…

---

## [Upcoming Rails workshops?](https://www.ruby-forum.com/t/upcoming-rails-workshops/119099)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 2\
**Last updated:** [November 3, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/upcoming-rails-workshops/119099 "2007-11-03T16:24:27Z")

</div>

I know the basics, but am continually getting hung up on the smallest things and need something to iron out all the wrinkles. So I guess I would be after something that quickly went over the basics, but also included …

---

## [Is there a "has\_one ..., :through"?](https://www.ruby-forum.com/t/is-there-a-has-one-through/119055)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 6\
**Last updated:** [November 3, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/is-there-a-has-one-through/119055 "2007-11-03T16:20:21Z")

</div>

I have found a few posts on various sites that this was something that was going to be available. The posts were all over a year ago, but it doesn’t seem like it is available in 1.2 unless I am missing something (whi…

---

## [Model caching reloading in development is making things slow](https://www.ruby-forum.com/t/model-caching-reloading-in-development-is-making-things-slow/119124)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 1\
**Last updated:** [November 3, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/model-caching-reloading-in-development-is-making-things-slow/119124 "2007-11-03T15:47:36Z")

</div>

In my development env, I was working on a module in my rails app. This action was taking approximately 7 seconds to complete. I was adding in tracing marks to figure out where which actions were taking the longest. Al…

---

## [Installing plugin offline](https://www.ruby-forum.com/t/installing-plugin-offline/119102)

<div class="topic-metadata">

**Author:** [@amirj26](https://www.ruby-forum.com/u/amirj26)\
**Replies:** 1\
**Last updated:** [November 3, 2007, 3:45pm UTC](https://www.ruby-forum.com/t/installing-plugin-offline/119102 "2007-11-03T15:45:51Z")

</div>

I have tried everything I can possibly think of to install a rails plugin without being connected to the internet. Specifically, I’m wanting to try out the streamlined and active scaffold plugins to compare the 2 and …

---

## [Http://manuals.rubyonrails.com didn't working?](https://www.ruby-forum.com/t/http-manuals-rubyonrails-com-didnt-working/119130)

<div class="topic-metadata">

**Author:** [@Davi](https://www.ruby-forum.com/u/Davi)\
**Replies:** 0\
**Last updated:** [November 3, 2007, 3:12pm UTC](https://www.ruby-forum.com/t/http-manuals-rubyonrails-com-didnt-working/119130 "2007-11-03T15:12:31Z")

</div>

I can’t access http://manuals.rubyonrails.com and it gives me 404 error. Someone knows what’s going on? Thanks Davi V. E-mail: removed\_email\_address@domain.invalid MSN : removed\_email\_address@domain.invalid GTalk…

---

## [FaceBook and GoogleMaps](https://www.ruby-forum.com/t/facebook-and-googlemaps/119116)

<div class="topic-metadata">

**Author:** [@chandoo](https://www.ruby-forum.com/u/chandoo)\
**Replies:** 2\
**Last updated:** [November 3, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/facebook-and-googlemaps/119116 "2007-11-03T15:01:34Z")

</div>

Hi, I had an application Of ruby rails up and running. Now i want to add google maps in that for which i have to use canvas only. Could some one tell me some suggestion to make it. Actually i am having two text fiel…

---

## [Nil? and blank?](https://www.ruby-forum.com/t/nil-and-blank/116800)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 7\
**Last updated:** [November 3, 2007, 1:36pm UTC](https://www.ruby-forum.com/t/nil-and-blank/116800 "2007-11-03T13:36:01Z")

</div>

I’ve heard this question asked before but I couldn’t find the appropriate responces that I was looking for, but what is the difference between Object.nil? and Object.blank? Is it how one handles white and newline char…

---

## [RMagick and Tempfile and StringIO](https://www.ruby-forum.com/t/rmagick-and-tempfile-and-stringio/118081)

<div class="topic-metadata">

**Author:** [@dohmer](https://www.ruby-forum.com/u/dohmer)\
**Replies:** 3\
**Last updated:** [November 3, 2007, 12:46pm UTC](https://www.ruby-forum.com/t/rmagick-and-tempfile-and-stringio/118081 "2007-11-03T12:46:48Z")

</div>

I’ve got a file upload that uploads an image to a server. That image is then manipulated via rmagick. I’ve only just found that for files less than 10KB in size, that the object is not a Tempfile, but a StringIO. If …

---

## [Averages in rails? Like an average user rating?](https://www.ruby-forum.com/t/averages-in-rails-like-an-average-user-rating/119101)

<div class="topic-metadata">

**Author:** [@jakedgr8](https://www.ruby-forum.com/u/jakedgr8)\
**Replies:** 4\
**Last updated:** [November 3, 2007, 6:08am UTC](https://www.ruby-forum.com/t/averages-in-rails-like-an-average-user-rating/119101 "2007-11-03T06:08:06Z")

</div>

Ok so this may seem simple but I don’t even know what to do here. This seems like some sort of “ruby math” maybe? Ok so here is what I want to do: I want users to submit a user rating from 1-10. How about a drop-down …

---

## [Creating docs for drb, need help](https://www.ruby-forum.com/t/creating-docs-for-drb-need-help/119108)

<div class="topic-metadata">

**Author:** [@yottameter](https://www.ruby-forum.com/u/yottameter)\
**Replies:** 0\
**Last updated:** [November 3, 2007, 5:27am UTC](https://www.ruby-forum.com/t/creating-docs-for-drb-need-help/119108 "2007-11-03T05:27:50Z")

</div>

I’m creating a session/drb document, trying to collect all the random bits out there. http://wiki.rubyonrails.org/rails/pages/HowToUseSessionsWithDrb I have a DrbStore session server running, but I would like to query…

---

## [Newbie: What is WSDL?](https://www.ruby-forum.com/t/newbie-what-is-wsdl/119103)

<div class="topic-metadata">

**Author:** [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Replies:** 1\
**Last updated:** [November 3, 2007, 5:07am UTC](https://www.ruby-forum.com/t/newbie-what-is-wsdl/119103 "2007-11-03T05:07:24Z")

</div>

Allow downloading Web Service WSDL as a file with an extension instead of a file named ‘wsdl’ map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’ That’s in the routes file, but what’s it for/mean? Thanks! Stedwi…

---

## [Webrick 500 error](https://www.ruby-forum.com/t/webrick-500-error/117104)

<div class="topic-metadata">

**Author:** [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Replies:** 7\
**Last updated:** [November 3, 2007, 4:34am UTC](https://www.ruby-forum.com/t/webrick-500-error/117104 "2007-11-03T04:34:39Z")

</div>

Hi, This is my second question on the poor performance of webrick (previously I had a problem with Ajax). I have a somewhat simple Rails application which works just fine, but when I come back to work the next day, t…

---

## [Presentation slides from a five day introductory Ruby on Rails course available for free](https://www.ruby-forum.com/t/presentation-slides-from-a-five-day-introductory-ruby-on-rails-course-available-for-free/119076)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 1\
**Last updated:** [November 3, 2007, 3:35am UTC](https://www.ruby-forum.com/t/presentation-slides-from-a-five-day-introductory-ruby-on-rails-course-available-for-free/119076 "2007-11-03T03:35:43Z")

</div>

Hello! I thought I’d mention here that the presentation slides (340 pages) from a course I held this summer are available under a creative commons license for download here: http://marklunds.com/articles/one/374 I h…

---

## [Ruby-oci8 build fails](https://www.ruby-forum.com/t/ruby-oci8-build-fails/119049)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 3\
**Last updated:** [November 3, 2007, 2:21am UTC](https://www.ruby-forum.com/t/ruby-oci8-build-fails/119049 "2007-11-03T02:21:29Z")

</div>

I’m trying to build the ruby-oci8 with the Oracle Instant Client on OS X. The Instant Client works, and the make seems to be ok with it up until OCIInitialize(). Anybody got this to work? \[relevant output\] /System/Li…

---

## [Why are both of these validations not working?](https://www.ruby-forum.com/t/why-are-both-of-these-validations-not-working/119093)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 0\
**Last updated:** [November 3, 2007, 1:31am UTC](https://www.ruby-forum.com/t/why-are-both-of-these-validations-not-working/119093 "2007-11-03T01:31:51Z")

</div>

validates\_presence\_of :region, :if =\> \[“CA”, “US”\].include?(:country) validates\_presence\_of :region, :if =\> Proc.new { |a| \[“CA”, “US”\].include?(a.country) } The top one works, but the bottom does not. Obviously the …

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

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