# Rails

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

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

---

## [Switching to Rails 2.1](https://www.ruby-forum.com/t/switching-to-rails-2-1/146500)

<div class="topic-metadata">

**Author:** [@birk](https://www.ruby-forum.com/u/birk)\
**Replies:** 4\
**Last updated:** [September 9, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/switching-to-rails-2-1/146500 "2008-09-09T17:07:08Z")

</div>

Hi everyone. Here is my problem: I’ve been working on a RoR project for a while (its quite big project), but have to stop the work on it for some half a year. Now I’m back on it and I’d like to switch to the newest v…

---

## [How can i use AR to save french and japanese?](https://www.ruby-forum.com/t/how-can-i-use-ar-to-save-french-and-japanese/196801)

<div class="topic-metadata">

**Author:** [@feeling3\_4](https://www.ruby-forum.com/u/feeling3_4)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/how-can-i-use-ar-to-save-french-and-japanese/196801 "2008-09-09T16:24:25Z")

</div>

hi, all i had a strange problem that i can not use ActiveRecord to save french and japanese. i use Tmail and mms2r to parse a mail, and i have a mail model in the db, the mail model has a txt\_body column. After i ha…

---

## [(Dir.glob("#{@path}/\*\*/\*/\*\*") | Dir.glob("#{@path}/\*\*")) != Dir.glob("#{@path}/\*\*")?](https://www.ruby-forum.com/t/dir-glob-path-dir-glob-path-dir-glob-path/148120)

<div class="topic-metadata">

**Author:** [@dracko](https://www.ruby-forum.com/u/dracko)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 4:04pm UTC](https://www.ruby-forum.com/t/dir-glob-path-dir-glob-path-dir-glob-path/148120 "2008-09-09T16:04:46Z")

</div>

I tried to ask this question once in Ruby-talk and inside another post in this list. No one answered me and I doubt anyone is able to answer it. So, I tried changing the subject in a weird, although correct question, …

---

## [Form\_for submit to a custom action](https://www.ruby-forum.com/t/form-for-submit-to-a-custom-action/148105)

<div class="topic-metadata">

**Author:** [@plambert](https://www.ruby-forum.com/u/plambert)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/form-for-submit-to-a-custom-action/148105 "2008-09-09T14:18:30Z")

</div>

hi forum, I am new to rails, and i am just getting my hang of things. Problem, how do you pass content captured in a form to a custom method? I have the following form: \<% form\_for :message, @message, :url =\> { :act…

---

## [Generate serialized attribute in fixture](https://www.ruby-forum.com/t/generate-serialized-attribute-in-fixture/148107)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 12:26pm UTC](https://www.ruby-forum.com/t/generate-serialized-attribute-in-fixture/148107 "2008-09-09T12:26:16Z")

</div>

Is there anyway to generate a serialized attribute like this one inside the fixture : knowledge: “— \\n- 1\\n- 3\\n- 5\\n- 7\\n” I tried knowledge: \<%= \[1, 3, 5, 7\].to\_yaml %\> doesn’t not work… so I do it using irb, the…

---

## [MissingSourceFile error](https://www.ruby-forum.com/t/missingsourcefile-error/148101)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 11:00am UTC](https://www.ruby-forum.com/t/missingsourcefile-error/148101 "2008-09-09T11:00:10Z")

</div>

I created a rails application by “rails demo” command and generated a controller “script/generate controller Say”. Then I created a file in app/view/say/hello.html.erb. I added a method “hello” in app/controllers/say\_…

---

## [The Back Button and multiple form submits](https://www.ruby-forum.com/t/the-back-button-and-multiple-form-submits/148052)

<div class="topic-metadata">

**Author:** [@S\_simon\_S](https://www.ruby-forum.com/u/S_simon_S)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 9:49am UTC](https://www.ruby-forum.com/t/the-back-button-and-multiple-form-submits/148052 "2008-09-09T09:49:09Z")

</div>

Pretty standard stuff: User fills out form User submits form User thinks “doh! an error!” User hits the browser back button User updates the data in the form User thinks he is updating the data by hitting submit again,…

---

## [Cropping with Attachment Fu](https://www.ruby-forum.com/t/cropping-with-attachment-fu/147915)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 7:18am UTC](https://www.ruby-forum.com/t/cropping-with-attachment-fu/147915 "2008-09-09T07:18:22Z")

</div>

Hello- I’m trying to work out the options for cropping an image into a square image. Basically, I want a picture turned into a 200x200 image. If the source picture is in landscape mode, then I want slivers of the righ…

---

## [Is there a rails equivalent to the java "tiles" layout approach for JSP pages?](https://www.ruby-forum.com/t/is-there-a-rails-equivalent-to-the-java-tiles-layout-approach-for-jsp-pages/148092)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 6:32am UTC](https://www.ruby-forum.com/t/is-there-a-rails-equivalent-to-the-java-tiles-layout-approach-for-jsp-pages/148092 "2008-09-09T06:32:10Z")

</div>

Hi, Anyone know whether there is a rails equivalent Apache Tiles - Framework - Home, which is an approach to help layout pages? tks

---

## [To learn REST](https://www.ruby-forum.com/t/to-learn-rest/148016)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 5:53am UTC](https://www.ruby-forum.com/t/to-learn-rest/148016 "2008-09-09T05:53:06Z")

</div>

Hi Could anybody please point me to some good links ,and railsmovies to learn REST on rails.I am a beginner to this subject in rails. I am using rails 1.2.5 Thanks in advance Sijo

---

## [Rails overriding database default value?](https://www.ruby-forum.com/t/rails-overriding-database-default-value/147798)

<div class="topic-metadata">

**Author:** [@pepe](https://www.ruby-forum.com/u/pepe)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 4:56am UTC](https://www.ruby-forum.com/t/rails-overriding-database-default-value/147798 "2008-09-09T04:56:45Z")

</div>

Hello. This is a new post for a message I didn’t get any answers to. I hope this post catches somebody’s eye and helps me with the issue. Sorry for the duplication but this is driving me nuts. The environment is: R…

---

## [Pagination and sorting](https://www.ruby-forum.com/t/pagination-and-sorting/147894)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 6\
**Last updated:** [September 9, 2008, 4:29am UTC](https://www.ruby-forum.com/t/pagination-and-sorting/147894 "2008-09-09T04:29:52Z")

</div>

Hi all, I’ve got a list of machines with columns like so: Hostname, Operating System, Location I have setup pagination with paginating\_find and that works nicely. I have also setup column sorting with my own little h…

---

## [Group By Hash Problem. Help!](https://www.ruby-forum.com/t/group-by-hash-problem-help/148068)

<div class="topic-metadata">

**Author:** [@blink](https://www.ruby-forum.com/u/blink)\
**Replies:** 1\
**Last updated:** [September 9, 2008, 3:45am UTC](https://www.ruby-forum.com/t/group-by-hash-problem-help/148068 "2008-09-09T03:45:24Z")

</div>

I have a current\_user via resthul\_auth thast HABTM projects. In my projects\_controller’s index action, I have def index @page\_title = “All Projects” if current\_user.admin? @projects = current\_account.projects else …

---

## [OT: 3 Passes for WindyCityRails up for grabs](https://www.ruby-forum.com/t/ot-3-passes-for-windycityrails-up-for-grabs/147908)

<div class="topic-metadata">

**Author:** [@Macel](https://www.ruby-forum.com/u/Macel)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 2:50am UTC](https://www.ruby-forum.com/t/ot-3-passes-for-windycityrails-up-for-grabs/147908 "2008-09-09T02:50:56Z")

</div>

If you want to attend the WindyCityRails Conference (Sept. 20th - Chicago, IL) but you did not have the chance to purchase a pass, it’s not too late. Morph Labs is giving free tickets to three local Rails developers.…

---

## [Please help: ar\_sendmail not sending emails](https://www.ruby-forum.com/t/please-help-ar-sendmail-not-sending-emails/148082)

<div class="topic-metadata">

**Author:** [@LAB](https://www.ruby-forum.com/u/LAB)\
**Replies:** 1\
**Last updated:** [September 9, 2008, 2:32am UTC](https://www.ruby-forum.com/t/please-help-ar-sendmail-not-sending-emails/148082 "2008-09-09T02:32:48Z")

</div>

Hello! I’m using ar\_mailer 1.3.1. I had everything working in my last hosting environment, ar\_sendmail would run and send the messages out of the emails table. I just changed servers and on the new server ar\_sendma…

---

## [Reload Everything (lib/plugins/vendor/the lot)](https://www.ruby-forum.com/t/reload-everything-lib-plugins-vendor-the-lot/140026)

<div class="topic-metadata">

**Author:** [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Replies:** 8\
**Last updated:** [September 9, 2008, 2:05am UTC](https://www.ruby-forum.com/t/reload-everything-lib-plugins-vendor-the-lot/140026 "2008-09-09T02:05:54Z")

</div>

Is there a way to reload everything on each request. I’m working with a lot of lib and vendor/plugin files, and in development mode i’d like to have all of those reloaded. I used to have a couple of methods that work…

---

## [How can I remove messages from Errors object?](https://www.ruby-forum.com/t/how-can-i-remove-messages-from-errors-object/148042)

<div class="topic-metadata">

**Author:** [@charlesr](https://www.ruby-forum.com/u/charlesr)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 1:22am UTC](https://www.ruby-forum.com/t/how-can-i-remove-messages-from-errors-object/148042 "2008-09-09T01:22:03Z")

</div>

I’m trying to handle complex form (nested forms) validation. (Using this link as #75 Complex Forms Part 3 - RailsCasts as how I’m setting up the complex forms.) Things are working ok, except that I’m getting a few ext…

---

## [Number of results](https://www.ruby-forum.com/t/number-of-results/148077)

<div class="topic-metadata">

**Author:** [@blueshadow](https://www.ruby-forum.com/u/blueshadow)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 12:24am UTC](https://www.ruby-forum.com/t/number-of-results/148077 "2008-09-09T00:24:50Z")

</div>

hello i wont to count number of results from database.All and search (number of search)results… how u do this in rails. thanks

---

## [Restful Authentication and State Machine state transfer question](https://www.ruby-forum.com/t/restful-authentication-and-state-machine-state-transfer-question/148065)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 2\
**Last updated:** [September 8, 2008, 11:29pm UTC](https://www.ruby-forum.com/t/restful-authentication-and-state-machine-state-transfer-question/148065 "2008-09-08T23:29:20Z")

</div>

I’m adding some code to a project using restful\_authentication and acts\_as\_statemachine In the create method for a user there is the following code generated by the restful\_authentication template @user.regster! if u…

---

## [Request.referer](https://www.ruby-forum.com/t/request-referer/148045)

<div class="topic-metadata">

**Author:** [@ajitonrails](https://www.ruby-forum.com/u/ajitonrails)\
**Replies:** 1\
**Last updated:** [September 8, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/request-referer/148045 "2008-09-08T23:14:04Z")

</div>

hello All I am passing some form value from one page to another and if something is missing from form value redirecting user back to home page, following is code to redirect back: redirect\_to request.referer ? :back …

---

## [Simple\_format, (long) urls, and wrapping](https://www.ruby-forum.com/t/simple-format-long-urls-and-wrapping/144168)

<div class="topic-metadata">

**Author:** [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Replies:** 4\
**Last updated:** [September 8, 2008, 11:03pm UTC](https://www.ruby-forum.com/t/simple-format-long-urls-and-wrapping/144168 "2008-09-08T23:03:43Z")

</div>

I’m using simple\_format to format and display posted content from users. This content sometimes has urls in it. The problem I’m having is that if the urls are long enough to wrap, they do, but the url gets split with …

---

## [Configuring custom library](https://www.ruby-forum.com/t/configuring-custom-library/147898)

<div class="topic-metadata">

**Author:** [@javinto](https://www.ruby-forum.com/u/javinto)\
**Replies:** 6\
**Last updated:** [September 8, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/configuring-custom-library/147898 "2008-09-08T22:51:20Z")

</div>

Hi, I’ve added a custom library called lib\\AccountSystem like so: "module AccountSystem SINGLE = 1 MULTIPLE = 2 class \<\< self attr\_accessor :account\_system\_type end end" Now I wanna configure AccountSystem.acc…

---

## [Configuring an object inheriting from actionmailer](https://www.ruby-forum.com/t/configuring-an-object-inheriting-from-actionmailer/148067)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 0\
**Last updated:** [September 8, 2008, 10:25pm UTC](https://www.ruby-forum.com/t/configuring-an-object-inheriting-from-actionmailer/148067 "2008-09-08T22:25:17Z")

</div>

I’ve been attempting to create a simple postback script using ruby, one that takes what is sent to it (cgi) and emails it out (action mailer). I ran into some problems (cgi values weren’t coming through whenever I req…

---

## [304 Error](https://www.ruby-forum.com/t/304-error/147663)

<div class="topic-metadata">

**Author:** [@joel](https://www.ruby-forum.com/u/joel)\
**Replies:** 2\
**Last updated:** [September 8, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/304-error/147663 "2008-09-08T22:22:21Z")

</div>

Hi guys, how can I resolve a 304 http error from my browser ? Thanks in advance, Joel

---

## [Uninitialized constant error with restful authentication](https://www.ruby-forum.com/t/uninitialized-constant-error-with-restful-authentication/148064)

<div class="topic-metadata">

**Author:** [@fromjavatorails](https://www.ruby-forum.com/u/fromjavatorails)\
**Replies:** 0\
**Last updated:** [September 8, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error-with-restful-authentication/148064 "2008-09-08T22:21:17Z")

</div>

I’m trying to set up restful authentication with Rails 2.1.0 on Mac OS X Leopard, and I had to comment out RAILS\_GEM\_VERSION in the environment file to install the plugin from technoweenie. Now I’m trying to follow a…

---

## [Amateur Programmer](https://www.ruby-forum.com/t/amateur-programmer/148059)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 2\
**Last updated:** [September 8, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/amateur-programmer/148059 "2008-09-08T22:21:08Z")

</div>

Hi, I have two questions: How do you cast in RoR2? I have this: \<% … total = 0; (@person.quizzes).each { |a| puts total+=a } .... %\> \<%= total %\> However, the compiler treats a as a string. I want it to be …

---

## [HOw do I perform this conditional validation?](https://www.ruby-forum.com/t/how-do-i-perform-this-conditional-validation/147977)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [September 8, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/how-do-i-perform-this-conditional-validation/147977 "2008-09-08T21:50:37Z")

</div>

Hi, I have this validation rule to check if the user-entered date of birth is at least 18 years of age … validates\_each :date\_of\_birth do |record, attr, value| record.errors.add attr, “You must be at least 18 years o…

---

## [Very special app design question](https://www.ruby-forum.com/t/very-special-app-design-question/148060)

<div class="topic-metadata">

**Author:** [@christoph](https://www.ruby-forum.com/u/christoph)\
**Replies:** 1\
**Last updated:** [September 8, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/very-special-app-design-question/148060 "2008-09-08T21:03:25Z")

</div>

Hi all ! I’m currently developing a game using Ruby On Rails and have a question on how to design my controller, given the following concept: There are the following models: Product, Offer, Storage, User (and others,…

---

## [Best way to send JSON request/get a response from controller?](https://www.ruby-forum.com/t/best-way-to-send-json-request-get-a-response-from-controller/148056)

<div class="topic-metadata">

**Author:** [@typej](https://www.ruby-forum.com/u/typej)\
**Replies:** 0\
**Last updated:** [September 8, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/best-way-to-send-json-request-get-a-response-from-controller/148056 "2008-09-08T19:38:36Z")

</div>

Hello Friends, What is the best way to send json from your controller, and await for a response? Ajax? Ruby’s net/http? The JSON server that I am sending the request to only accept POST methods, and sends a POST bac…

---

## [Weird error in Hash.to\_json](https://www.ruby-forum.com/t/weird-error-in-hash-to-json/147988)

<div class="topic-metadata">

**Author:** [@Mike\_Travers](https://www.ruby-forum.com/u/Mike_Travers)\
**Replies:** 2\
**Last updated:** [September 8, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/weird-error-in-hash-to-json/147988 "2008-09-08T19:35:40Z")

</div>

{}.to\_json() =\> “{}” {}.to\_json({}) TypeError: wrong argument type Hash (expected Data) from (irb):4:in \`to\_json’ from (irb):4 This is in Ruby 1.8.6, Rails 2.1.1…but for some reason reloading the source fix…

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

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