# Rails

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

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

---

## [Rails + Rest](https://www.ruby-forum.com/t/rails-rest/107276)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 11:54pm UTC](https://www.ruby-forum.com/t/rails-rest/107276 "2007-06-19T23:54:02Z")

</div>

I found myself blocked trying to think of Restful ways of doing things, until I subscribed to the peepcode screencast. Even so, I prefer using regular controllers in the initial stages when evolution of model relation…

---

## [Display Options While Paginating](https://www.ruby-forum.com/t/display-options-while-paginating/107272)

<div class="topic-metadata">

**Author:** [@partydrone](https://www.ruby-forum.com/u/partydrone)\
**Replies:** 1\
**Last updated:** [June 19, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/display-options-while-paginating/107272 "2007-06-19T23:03:55Z")

</div>

I have a table full of articles that I want to paginate. Easy enough with: \[Controller\] @article\_pages, @articles = paginate(:articles, :per\_page =\> 20, :order =\> ‘post\_date DESC, title ASC’) BUT, there are differen…

---

## [Alias\_method\_chain and Class methods (a Ruby question)](https://www.ruby-forum.com/t/alias-method-chain-and-class-methods-a-ruby-question/163911)

<div class="topic-metadata">

**Author:** [@christos](https://www.ruby-forum.com/u/christos)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 10:26pm UTC](https://www.ruby-forum.com/t/alias-method-chain-and-class-methods-a-ruby-question/163911 "2007-06-19T22:26:52Z")

</div>

Hello list, I am trying to override the post\_form method of Net::HTTP so that it does something before actually doing the post. I tried the following in environments/development.rb module Net class HTTP alias\_meth…

---

## [Overly complex controller?](https://www.ruby-forum.com/t/overly-complex-controller/225953)

<div class="topic-metadata">

**Author:** [@tayknight](https://www.ruby-forum.com/u/tayknight)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 10:13pm UTC](https://www.ruby-forum.com/t/overly-complex-controller/225953 "2007-06-19T22:13:50Z")

</div>

Hi all. A simple app. Albums have songs. Songs have artists. Models look like: class Album \< ActiveRecord::Base has\_many :albumappearances has\_many :songs, :through =\> :albumappearances validates\_length\_of :descript…

---

## [Javascript\_tag replacing whitespaces w/ '%20'](https://www.ruby-forum.com/t/javascript-tag-replacing-whitespaces-w-20/107269)

<div class="topic-metadata">

**Author:** [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 9:34pm UTC](https://www.ruby-forum.com/t/javascript-tag-replacing-whitespaces-w-20/107269 "2007-06-19T21:34:42Z")

</div>

Hello, I have a form that tests if a title has been changed since the page was loaded and the page has been submitted. If the page title has been changed then a confirm box will ask if the user wants to have the ti…

---

## [Showing a menu from an array](https://www.ruby-forum.com/t/showing-a-menu-from-an-array/107267)

<div class="topic-metadata">

**Author:** [@JolSSSS](https://www.ruby-forum.com/u/JolSSSS)\
**Replies:** 1\
**Last updated:** [June 19, 2007, 9:33pm UTC](https://www.ruby-forum.com/t/showing-a-menu-from-an-array/107267 "2007-06-19T21:33:42Z")

</div>

Hi, I want to show a menu on my page. The menu items are fetched from an array called menu\_pages. What I would like to accomplish is this -\> blog | photos | movies I’m using “|” in my view as a separator. The problem…

---

## [Javascript\_tag replacing whitespaces w/ '%20'](https://www.ruby-forum.com/t/javascript-tag-replacing-whitespaces-w-20/107268)

<div class="topic-metadata">

**Author:** [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/javascript-tag-replacing-whitespaces-w-20/107268 "2007-06-19T21:32:02Z")

</div>

javascript\_tag replacing whitespaces w/ ‘%20’ Hello, I have a form that tests if a title has been changed since the page was loaded and the page has been submitted. If the page title has been changed then a confirm …

---

## [Html special chars](https://www.ruby-forum.com/t/html-special-chars/107264)

<div class="topic-metadata">

**Author:** [@damianrr](https://www.ruby-forum.com/u/damianrr)\
**Replies:** 3\
**Last updated:** [June 19, 2007, 9:03pm UTC](https://www.ruby-forum.com/t/html-special-chars/107264 "2007-06-19T21:03:38Z")

</div>

Hi, i have a database with data that contains special html chars … for example, i may have names like “damiÃ¡n” “guzmÃ¡n” and they get displayed like “dami?n” and “guzm?n” in the browser, i need a render function that …

---

## [Ruby On Rails Programmer Needed](https://www.ruby-forum.com/t/ruby-on-rails-programmer-needed/107215)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [June 19, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-programmer-needed/107215 "2007-06-19T20:56:38Z")

</div>

Looking for a highly experienced Ruby on Rails programmer for an upcoming e-commerce project. Pay will be based on experience. Please send a resume, work history and experience along with some examples of your work i…

---

## [Save attachment to oracle database](https://www.ruby-forum.com/t/save-attachment-to-oracle-database/107259)

<div class="topic-metadata">

**Author:** [@archangel77](https://www.ruby-forum.com/u/archangel77)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 7:44pm UTC](https://www.ruby-forum.com/t/save-attachment-to-oracle-database/107259 "2007-06-19T19:44:27Z")

</div>

Hi, I want to save my attachment files to an oracle database. I want the file to be in a database column and not in the file system. Can anyone help me with this? Thanks!

---

## [Hotmail and japanese](https://www.ruby-forum.com/t/hotmail-and-japanese/106855)

<div class="topic-metadata">

**Author:** [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Replies:** 1\
**Last updated:** [June 19, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/hotmail-and-japanese/106855 "2007-06-19T19:28:24Z")

</div>

anyone had any experience with sending japanese email to hotmail. if i change the encoding to Shift-JS then it comes out funy (mojabake) in yahoo etc. do i need to test each email address then set the encoding accord…

---

## [Handling referrals](https://www.ruby-forum.com/t/handling-referrals/107260)

<div class="topic-metadata">

**Author:** [@jgjgjg](https://www.ruby-forum.com/u/jgjgjg)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/handling-referrals/107260 "2007-06-19T19:21:23Z")

</div>

I’m working on an invite/referral part of an app and am trying to figure the best approach to link the user who invited the person with that person when he/she signs up. Is there a method to generate a url that includ…

---

## [Can't download files with send\_data or send\_file](https://www.ruby-forum.com/t/cant-download-files-with-send-data-or-send-file/106278)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 6\
**Last updated:** [June 19, 2007, 7:11pm UTC](https://www.ruby-forum.com/t/cant-download-files-with-send-data-or-send-file/106278 "2007-06-19T19:11:21Z")

</div>

I have a form\_remote\_tag that calls a method to print out a csv file for download. If I tell the form\_remote\_tag to update a div the data comes up in that div, but otherwise I can’t get the browser to acknowledge th…

---

## [Attachment\_fu, better feedback on errors](https://www.ruby-forum.com/t/attachment-fu-better-feedback-on-errors/107253)

<div class="topic-metadata">

**Author:** [@ramontayag](https://www.ruby-forum.com/u/ramontayag)\
**Replies:** 1\
**Last updated:** [June 19, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/attachment-fu-better-feedback-on-errors/107253 "2007-06-19T18:54:18Z")

</div>

Hi everyone! I’m using attachment\_fu to attach an image to a property model. Sometimes the image uploads, but sometimes it fails. How do i get a better error when it fails? dev.log doesn’t say much. See my method cod…

---

## [Commit every Nth INSERT in migration](https://www.ruby-forum.com/t/commit-every-nth-insert-in-migration/107159)

<div class="topic-metadata">

**Author:** [@jendaperl](https://www.ruby-forum.com/u/jendaperl)\
**Replies:** 8\
**Last updated:** [June 19, 2007, 6:52pm UTC](https://www.ruby-forum.com/t/commit-every-nth-insert-in-migration/107159 "2007-06-19T18:52:17Z")

</div>

We are importing some data into the lookup tables in a mysql database in the migration and it’t insanely slow. Even more than I’d expect from Ruby. I extracted the import of a single table into a script and trimmed th…

---

## [\[ANN\] Lone Star Rubyconf 2007 - Speakers, Hotel and Training](https://www.ruby-forum.com/t/ann-lone-star-rubyconf-2007-speakers-hotel-and-training/107255)

<div class="topic-metadata">

**Author:** [@sauy7](https://www.ruby-forum.com/u/sauy7)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 6:20pm UTC](https://www.ruby-forum.com/t/ann-lone-star-rubyconf-2007-speakers-hotel-and-training/107255 "2007-06-19T18:20:10Z")

</div>

Howdy All Lone Star Rubyconf 2007 has been making great progress and we have now published the information you have been asking for. The conference hotel is AmeriSuites, with a rate of $85 per night, plus tax. Amer…

---

## [ActionWebService for many APIs in rails?](https://www.ruby-forum.com/t/actionwebservice-for-many-apis-in-rails/107248)

<div class="topic-metadata">

**Author:** [@joaz](https://www.ruby-forum.com/u/joaz)\
**Replies:** 4\
**Last updated:** [June 19, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/actionwebservice-for-many-apis-in-rails/107248 "2007-06-19T18:17:54Z")

</div>

Hi, We’ve a pretty large rails application and we are currently deciding moving a part of the application front-end to a desktop GUI. For communication between application and GUI we decided to use an API. So basical…

---

## [Polymorphic validation](https://www.ruby-forum.com/t/polymorphic-validation/107214)

<div class="topic-metadata">

**Author:** [@pabloz](https://www.ruby-forum.com/u/pabloz)\
**Replies:** 2\
**Last updated:** [June 19, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/polymorphic-validation/107214 "2007-06-19T18:00:07Z")

</div>

Hello I have 2 models. link.rb has\_many :categories, :as =\> :categorized validates\_presence\_of :name, :url, :created\_at, :category category.rb belongs\_to :categorized, :polymorphic =\> true validates\_presence\_of :…

---

## [How to encode an email ? (spam protection)](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227)

<div class="topic-metadata">

**Author:** [@friofool](https://www.ruby-forum.com/u/friofool)\
**Replies:** 3\
**Last updated:** [June 19, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227 "2007-06-19T17:36:49Z")

</div>

hi, i would like to encode an email adresss in ascii format. How to do that in ruby, i can’t find a method. Maybe exist a rails plugin to protect email collecting ? Thanks for your help

---

## [\[ANN\]: Houston RoR Meeting Tonight](https://www.ruby-forum.com/t/ann-houston-ror-meeting-tonight/107249)

<div class="topic-metadata">

**Author:** [@klancaster](https://www.ruby-forum.com/u/klancaster)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/ann-houston-ror-meeting-tonight/107249 "2007-06-19T17:29:02Z")

</div>

Apologies for the late notice. The Houston Rails/Ruby group is meeting tonight at 6:00PM at the offices of DataCert. See Workspace not found for details on locations and topics. To join the group, visit http://tech.g…

---

## [Update action without model relationship](https://www.ruby-forum.com/t/update-action-without-model-relationship/107246)

<div class="topic-metadata">

**Author:** [@rainchen](https://www.ruby-forum.com/u/rainchen)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 5:28pm UTC](https://www.ruby-forum.com/t/update-action-without-model-relationship/107246 "2007-06-19T17:28:01Z")

</div>

I setup 3 models such as A,B,C A has\_many B B belongs\_to A B has\_many C C belongs\_to B I found when I use C.update, then B and A also would be updated. How to stop this affect,is there an option ?

---

## [ActiveRecord::Base.find returning columns from :joins](https://www.ruby-forum.com/t/activerecord-base-find-returning-columns-from-joins/107208)

<div class="topic-metadata">

**Author:** [@dutone](https://www.ruby-forum.com/u/dutone)\
**Replies:** 3\
**Last updated:** [June 19, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/activerecord-base-find-returning-columns-from-joins/107208 "2007-06-19T17:12:59Z")

</div>

Hi, I’m trying to find all of the products that have parts supplied by the given supplier’s name: @products=Product.find :all, :include=\>\[“company”,“parts”\], :joins=\>“inner join suppliers\_to\_parts stp on stp.part = …

---

## [Subscription based service in UK, which payment provider?](https://www.ruby-forum.com/t/subscription-based-service-in-uk-which-payment-provider/105962)

<div class="topic-metadata">

**Author:** [@dordille](https://www.ruby-forum.com/u/dordille)\
**Replies:** 1\
**Last updated:** [June 19, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/subscription-based-service-in-uk-which-payment-provider/105962 "2007-06-19T16:42:57Z")

</div>

Hi: After doing all the integration with trustcommerce I found out that you MUST have an US corporation to accept subscription based payment :frowning: I am back to square one! Anyway I was wondering does anyone kno…

---

## [Status code for failure to destroy](https://www.ruby-forum.com/t/status-code-for-failure-to-destroy/107241)

<div class="topic-metadata">

**Author:** [@liquid](https://www.ruby-forum.com/u/liquid)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 3:54pm UTC](https://www.ruby-forum.com/t/status-code-for-failure-to-destroy/107241 "2007-06-19T15:54:52Z")

</div>

Hi, Just wondering what the status code should be for a failed destroy. I think it’s out of these three. I’m leaning to 417 at the moment. Anyone have any input on this please? 403 =\> “Forbidden”, 406 =\> “Not Acce…

---

## [Back button for AJAX in rails](https://www.ruby-forum.com/t/back-button-for-ajax-in-rails/107236)

<div class="topic-metadata">

**Author:** [@difei](https://www.ruby-forum.com/u/difei)\
**Replies:** 4\
**Last updated:** [June 19, 2007, 3:39pm UTC](https://www.ruby-forum.com/t/back-button-for-ajax-in-rails/107236 "2007-06-19T15:39:50Z")

</div>

Greetings all, I am wondering are there any thing like link\_to\_remote(:update, :url) in rails which preserves the navigation feature (back & forward button as well as bookmarks) of the browser? Thanks very much! Chee…

---

## [Before updating scaffolding from new DB schema, try creating](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 3\
**Last updated:** [June 19, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106 "2007-06-19T15:15:47Z")

</div>

What does the message “error Before updating scaffolding from new DB schema, try creating a table for your model (Legacy)” mean? My googling shows that others have received similar messages, but it’s not clear to me…

---

## [Compare dates and get the difference](https://www.ruby-forum.com/t/compare-dates-and-get-the-difference/107171)

<div class="topic-metadata">

**Author:** [@jfjfjf](https://www.ruby-forum.com/u/jfjfjf)\
**Replies:** 3\
**Last updated:** [June 19, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/compare-dates-and-get-the-difference/107171 "2007-06-19T15:15:42Z")

</div>

What’s the best way to do math with RoR? I’m trying to compare two different records based on their timestamp, and I want to wind up with the difference between the two. (i.e. Number of days between the two timestamps…

---

## [Calling RESTful 'scoped' INDEX when params\[:parent.id\] is no](https://www.ruby-forum.com/t/calling-restful-scoped-index-when-params-parent-id-is-no/107235)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [June 19, 2007, 1:50pm UTC](https://www.ruby-forum.com/t/calling-restful-scoped-index-when-params-parent-id-is-no/107235 "2007-06-19T13:50:31Z")

</div>

I have a VERY hierchical database and am using a RESTful approach. Normally, when users’ enter the system they’ll cascade from level to level in the database and thus the hierchical information such as child.parent.…

---

## [Using ERB to generate file on disk?](https://www.ruby-forum.com/t/using-erb-to-generate-file-on-disk/107150)

<div class="topic-metadata">

**Author:** [@redgar](https://www.ruby-forum.com/u/redgar)\
**Replies:** 4\
**Last updated:** [June 19, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/using-erb-to-generate-file-on-disk/107150 "2007-06-19T13:16:24Z")

</div>

Hi, I would like to write form data into a file, and I would like to know if there’s a way for me to use an ERB template directly to output the file to disk? I was going to use a series of puts(“Full name: @order.ful…

---

## [Critical \*weird\* error! :(](https://www.ruby-forum.com/t/critical-weird-error/107177)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [June 19, 2007, 1:03pm UTC](https://www.ruby-forum.com/t/critical-weird-error/107177 "2007-06-19T13:03:18Z")

</div>

user model has\_one :paying\_user, :dependent =\> :destroy paying\_user model set\_primary\_key :user\_id belongs\_to :user has\_one :credit\_card, :foreign\_key =\> ‘user\_id’, :dependent =\> :destroy I can load and print \<…

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

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