# Rails

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

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

---

## [Redefining before\_validation for an ActiveRecord model](https://www.ruby-forum.com/t/redefining-before-validation-for-an-activerecord-model/127138)

<div class="topic-metadata">

**Author:** [@Wim\_Ceulemans](https://www.ruby-forum.com/u/Wim_Ceulemans)\
**Replies:** 0\
**Last updated:** [January 25, 2008, 11:07am UTC](https://www.ruby-forum.com/t/redefining-before-validation-for-an-activerecord-model/127138 "2008-01-25T11:07:57Z")

</div>

Hi I’m struggling more then a day now to try to write a simple plugin. Let me explain what the plugin should do. Consider a table called categories that looks like: create\_table :categories do |t| t.column :id, …

---

## [Ruby on Rails 2.0.2 error](https://www.ruby-forum.com/t/ruby-on-rails-2-0-2-error/126915)

<div class="topic-metadata">

**Author:** [@Kirushik](https://www.ruby-forum.com/u/Kirushik)\
**Replies:** 6\
**Last updated:** [January 25, 2008, 11:05am UTC](https://www.ruby-forum.com/t/ruby-on-rails-2-0-2-error/126915 "2008-01-25T11:05:01Z")

</div>

Hello, folks! I’m playing with rails in my debian lenny system, and I’m facing some unsolvable difficulties now. I’ve successfully installed rails, lighttpd and mysql from aptitude. Configuration took some time, but …

---

## [List of unchecked checkboxes](https://www.ruby-forum.com/t/list-of-unchecked-checkboxes/126385)

<div class="topic-metadata">

**Author:** [@enduro](https://www.ruby-forum.com/u/enduro)\
**Replies:** 6\
**Last updated:** [January 25, 2008, 10:55am UTC](https://www.ruby-forum.com/t/list-of-unchecked-checkboxes/126385 "2008-01-25T10:55:40Z")

</div>

Hi all Having kinda trouble with checkboxes. Let’s assume “Order has\_and\_belongs\_to\_many :products” and vice versa. Now let’s assume there are products with IDs 1, 2 and 3 in the db and I’m editing an existing Order …

---

## [Force reloading ANY arbitrary file](https://www.ruby-forum.com/t/force-reloading-any-arbitrary-file/127019)

<div class="topic-metadata">

**Author:** [@fero](https://www.ruby-forum.com/u/fero)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 10:47am UTC](https://www.ruby-forum.com/t/force-reloading-any-arbitrary-file/127019 "2008-01-25T10:47:26Z")

</div>

Hi folks. Help me. I want to force reloading any of many files of my project, that does not belong to standard (app/models etd) directory structure. I have tried ‘include Reloadable’ in my modules, but: it has been …

---

## [Orphans](https://www.ruby-forum.com/t/orphans/127058)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 6\
**Last updated:** [January 25, 2008, 10:32am UTC](https://www.ruby-forum.com/t/orphans/127058 "2008-01-25T10:32:30Z")

</div>

I’m trying to solve the problem of orphaned records, and wondering what the best solution is, maybe someone can help me with a little example code. I have the following models. Enquiry Course and when someone gener…

---

## [Errno::EINVAL (Invalid argument)](https://www.ruby-forum.com/t/errno-einval-invalid-argument/127130)

<div class="topic-metadata">

**Author:** [@Siddu](https://www.ruby-forum.com/u/Siddu)\
**Replies:** 2\
**Last updated:** [January 25, 2008, 7:47am UTC](https://www.ruby-forum.com/t/errno-einval-invalid-argument/127130 "2008-01-25T07:47:48Z")

</div>

Hi, I got Errno::EINVAL (Invalid argument) error… This error is occurred only when the system is inactive for more then 3hrs… I am using rails 1.2.5 with activescaffold 1.0.1 and mysql 6.0… and also using the mongrel…

---

## [Link\_to to pass an entire row of a table rather than by id](https://www.ruby-forum.com/t/link-to-to-pass-an-entire-row-of-a-table-rather-than-by-id/127129)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 7:38am UTC](https://www.ruby-forum.com/t/link-to-to-pass-an-entire-row-of-a-table-rather-than-by-id/127129 "2008-01-25T07:38:38Z")

</div>

Hi How can i use link\_to in form to pass an already fetched row of a table to an action.I can pass it by :id…But in action i have to again use the find method to get the rows again in show.rhtml I have \<%= link\_to…

---

## [Attachment\_fu calling strip on FileIO](https://www.ruby-forum.com/t/attachment-fu-calling-strip-on-fileio/127126)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 0\
**Last updated:** [January 25, 2008, 6:23am UTC](https://www.ruby-forum.com/t/attachment-fu-calling-strip-on-fileio/127126 "2008-01-25T06:23:42Z")

</div>

At least I seem to be doing something that is making it call the strip method. NoMethodError in AccountsController#create undefined method \`strip’ for #ActionController::UploadedStringIO:0x23df0c0 photo model class …

---

## [Attachment\_fu not resizing ALL images](https://www.ruby-forum.com/t/attachment-fu-not-resizing-all-images/127117)

<div class="topic-metadata">

**Author:** [@galeal](https://www.ruby-forum.com/u/galeal)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 6:06am UTC](https://www.ruby-forum.com/t/attachment-fu-not-resizing-all-images/127117 "2008-01-25T06:06:27Z")

</div>

I’ve found that images over 500kb do not get resized when you use attachment\_fu. These images are fairly large (screenshots in jpg) is there a way to force a resize? TIA

---

## [Will\_paginate and pagination in general](https://www.ruby-forum.com/t/will-paginate-and-pagination-in-general/127122)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 6:01am UTC](https://www.ruby-forum.com/t/will-paginate-and-pagination-in-general/127122 "2008-01-25T06:01:31Z")

</div>

I dont know what I am doing wrong. I was trying to use the pagination that is built into rails, wouldnt work, tried will\_paginate, still wont work. I have a drop down list where the user will choose one of the count…

---

## [Problem, specify fields with :includes in indexing & search](https://www.ruby-forum.com/t/problem-specify-fields-with-includes-in-indexing-search/127125)

<div class="topic-metadata">

**Author:** [@nad](https://www.ruby-forum.com/u/nad)\
**Replies:** 0\
**Last updated:** [January 25, 2008, 5:42am UTC](https://www.ruby-forum.com/t/problem-specify-fields-with-includes-in-indexing-search/127125 "2008-01-25T05:42:39Z")

</div>

hi all i have 2 models as bellow. what i want to do is when the data is save to the following table it has to index with data in all the files in the both models. so when i search search through the acts\_as\_solr it s…

---

## [Model creating a model?](https://www.ruby-forum.com/t/model-creating-a-model/127108)

<div class="topic-metadata">

**Author:** [@fox](https://www.ruby-forum.com/u/fox)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 5:31am UTC](https://www.ruby-forum.com/t/model-creating-a-model/127108 "2008-01-25T05:31:35Z")

</div>

hi all, is it possible for a model to create an object (of which it has many), when it is first created? i’m trying to have something like Image -hm-\> ImageThumbs where the first ImageThumb is created when the Image…

---

## [An elegant way of reusing Rails Test::Unit additions for Fit / Fitnesse fixtures](https://www.ruby-forum.com/t/an-elegant-way-of-reusing-rails-test-unit-additions-for-fit-fitnesse-fixtures/127123)

<div class="topic-metadata">

**Author:** [@Gishu\_Pillai](https://www.ruby-forum.com/u/Gishu_Pillai)\
**Replies:** 0\
**Last updated:** [January 25, 2008, 5:05am UTC](https://www.ruby-forum.com/t/an-elegant-way-of-reusing-rails-test-unit-additions-for-fit-fitnesse-fixtures/127123 "2008-01-25T05:05:52Z")

</div>

Hi, Rails testing support is awesome. I’ve been trying to use Fit - Fitnesse for acceptance testing. Soon I was missing my get and post helper methods - Since they are part of Test::Unit and fit fixtures have to deri…

---

## [CSRF / cached authenticity tokens / ajax requests](https://www.ruby-forum.com/t/csrf-cached-authenticity-tokens-ajax-requests/126978)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [January 25, 2008, 4:10am UTC](https://www.ruby-forum.com/t/csrf-cached-authenticity-tokens-ajax-requests/126978 "2008-01-25T04:10:55Z")

</div>

I’m going to go out on a limb here and say the new CSRF protection in Rails is flawed. Why? Forget about caching if you care to use it. Consider the following: \<% cache do %\> \<%= link\_to\_remote “Add To Favorites”, …

---

## [How to install TCLink on OS X? ruby-devel package?](https://www.ruby-forum.com/t/how-to-install-tclink-on-os-x-ruby-devel-package/111094)

<div class="topic-metadata">

**Author:** [@eblatt](https://www.ruby-forum.com/u/eblatt)\
**Replies:** 3\
**Last updated:** [January 25, 2008, 3:17am UTC](https://www.ruby-forum.com/t/how-to-install-tclink-on-os-x-ruby-devel-package/111094 "2008-01-25T03:17:37Z")

</div>

Hello, I’m trying to install TCLink library from www.trustcommerce.com/tclink.html as indicated in the ActiveMerchant documentation (http://activemerchant.rubyforge.org/). The README for TCLink v3.4.4 says: “Beside…

---

## [A way to have partials outside of the app/ directory?](https://www.ruby-forum.com/t/a-way-to-have-partials-outside-of-the-app-directory/127066)

<div class="topic-metadata">

**Author:** [@vinnie](https://www.ruby-forum.com/u/vinnie)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 3:11am UTC](https://www.ruby-forum.com/t/a-way-to-have-partials-outside-of-the-app-directory/127066 "2008-01-25T03:11:18Z")

</div>

I am building a site where only one section is dynamic the rest I want to serve statically. Is there a way to use erb in the public/ folder with static html pages?

---

## [Url\_for and routes with host](https://www.ruby-forum.com/t/url-for-and-routes-with-host/127119)

<div class="topic-metadata">

**Author:** [@etlund](https://www.ruby-forum.com/u/etlund)\
**Replies:** 0\
**Last updated:** [January 25, 2008, 2:54am UTC](https://www.ruby-forum.com/t/url-for-and-routes-with-host/127119 "2008-01-25T02:54:14Z")

</div>

I have a route the looks like this: map.preview\_profile ‘/profile/:client/:profile’, :controller =\> ‘profiles’, :action =\> ‘pub\_view’ if I do url\_for(:controller =\> ‘profiles’, :action =\> ‘pub\_view’, :client =\> ‘clie…

---

## [Date format](https://www.ruby-forum.com/t/date-format/127109)

<div class="topic-metadata">

**Author:** [@jimmypalmer](https://www.ruby-forum.com/u/jimmypalmer)\
**Replies:** 3\
**Last updated:** [January 25, 2008, 2:47am UTC](https://www.ruby-forum.com/t/date-format/127109 "2008-01-25T02:47:48Z")

</div>

looking for information on how to format a date.

---

## [Problems with link\_to\_remote](https://www.ruby-forum.com/t/problems-with-link-to-remote/127006)

<div class="topic-metadata">

**Author:** [@fries88](https://www.ruby-forum.com/u/fries88)\
**Replies:** 25\
**Last updated:** [January 25, 2008, 2:16am UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/127006 "2008-01-25T02:16:12Z")

</div>

Hi, I have been trying and searching for so long… I have a label, a text field and a link\_to\_remote link. In the rhtml, it looks like this: Item 0 \<%= n.text\_field :display\_bin\_txt %\> \<%= link\_to\_remote( "add", :…

---

## [Render doesn't find an html.erb file when called from a xml/atom builder?](https://www.ruby-forum.com/t/render-doesnt-find-an-html-erb-file-when-called-from-a-xml-atom-builder/126413)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [January 25, 2008, 1:48am UTC](https://www.ruby-forum.com/t/render-doesnt-find-an-html-erb-file-when-called-from-a-xml-atom-builder/126413 "2008-01-25T01:48:46Z")

</div>

I’m trying to put together an atom feed. In trying to keep things DRY it seemed to make sense to render each item in the feed with the same html partial that we used to render it on our website. Unfortunately render…

---

## [NVIDIA CAD team is looking for a UI Designer/ Ruby on Rails developer](https://www.ruby-forum.com/t/nvidia-cad-team-is-looking-for-a-ui-designer-ruby-on-rails-developer/127110)

<div class="topic-metadata">

**Author:** [@RoR\_recruiter](https://www.ruby-forum.com/u/RoR_recruiter)\
**Replies:** 0\
**Last updated:** [January 25, 2008, 1:17am UTC](https://www.ruby-forum.com/t/nvidia-cad-team-is-looking-for-a-ui-designer-ruby-on-rails-developer/127110 "2008-01-25T01:17:41Z")

</div>

RUBY ON RAILS WEB DEVELOPER #965422 NVIDIA CAD team is looking for a UI Designer/ Ruby on Rails developer to put web based front-ends on chip design workflows. This position requires solid understanding of HTML/CSS de…

---

## [Uploading files: wrong number of arguments (1 for 0)](https://www.ruby-forum.com/t/uploading-files-wrong-number-of-arguments-1-for-0/127107)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 1\
**Last updated:** [January 25, 2008, 12:59am UTC](https://www.ruby-forum.com/t/uploading-files-wrong-number-of-arguments-1-for-0/127107 "2008-01-25T00:59:53Z")

</div>

I am trying to upload a file (pretty simple stuff right?), but keep getting the argument error. I have cross referenced what I have to prior uses and cannot find any errors with what I have. /Library/Ruby/Gems/1.8/gem…

---

## [Help with Custom Rest Actions](https://www.ruby-forum.com/t/help-with-custom-rest-actions/127081)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 1\
**Last updated:** [January 24, 2008, 11:33pm UTC](https://www.ruby-forum.com/t/help-with-custom-rest-actions/127081 "2008-01-24T23:33:20Z")

</div>

How can I create a method like show and link to it from index? what should I put in routes.rb? what should I put to link to it?

---

## [WANTED: Ruby on Rails Developer](https://www.ruby-forum.com/t/wanted-ruby-on-rails-developer/127099)

<div class="topic-metadata">

**Author:** [@Gvannatter](https://www.ruby-forum.com/u/Gvannatter)\
**Replies:** 0\
**Last updated:** [January 24, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/wanted-ruby-on-rails-developer/127099 "2008-01-24T23:31:01Z")

</div>

This message is to reach out to the Ruby on Rails community in hopes of finding a developer that is interested in working a few hours a day on a small corporate project. This position will be paid on an hourly basis.…

---

## [Sql query in rails](https://www.ruby-forum.com/t/sql-query-in-rails/127093)

<div class="topic-metadata">

**Author:** [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Replies:** 1\
**Last updated:** [January 24, 2008, 11:25pm UTC](https://www.ruby-forum.com/t/sql-query-in-rails/127093 "2008-01-24T23:25:37Z")

</div>

Hello, Can anyone please tell me how do i write a sql query in rails in which only one field in not null and the others are null. FOr e.g. i want to find all records in which email is not null and all the other field…

---

## [ActiveResource or Ajax/XHR + REXML or similar for calling ashx webservice](https://www.ruby-forum.com/t/activeresource-or-ajax-xhr-rexml-or-similar-for-calling-ashx-webservice/127097)

<div class="topic-metadata">

**Author:** [@prism](https://www.ruby-forum.com/u/prism)\
**Replies:** 0\
**Last updated:** [January 24, 2008, 11:08pm UTC](https://www.ruby-forum.com/t/activeresource-or-ajax-xhr-rexml-or-similar-for-calling-ashx-webservice/127097 "2008-01-24T23:08:42Z")

</div>

Hi! I’m making an application to display logs that are returned from an external resource as XML. I’d like to use ActiveResource, but from what I understand it can’t be done out of the box, because the WS I’m callin…

---

## [Help with PDF Writer and link\_to](https://www.ruby-forum.com/t/help-with-pdf-writer-and-link-to/127091)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 1\
**Last updated:** [January 24, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/help-with-pdf-writer-and-link-to/127091 "2008-01-24T22:59:49Z")

</div>

I have this code in the controller: def search2 @repair\_tickets = RepairTicket.search(params\[:search\]\[:client\_id\],params\[:search\]\[:product\_id\],params\[:search\]\[:status\_id\],params\[:search\]\[:pos\_breakdown\_id\],params\[:sea…

---

## [Reloading Associations causes Tests to Fail](https://www.ruby-forum.com/t/reloading-associations-causes-tests-to-fail/127090)

<div class="topic-metadata">

**Author:** [@startrader](https://www.ruby-forum.com/u/startrader)\
**Replies:** 1\
**Last updated:** [January 24, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/reloading-associations-causes-tests-to-fail/127090 "2008-01-24T22:46:10Z")

</div>

I broke a test in an odd way today and it brought up some design and testing questions. I was working through some problems in my integration tests, and all was going well. I found that to get a certain test to pass,…

---

## [Wrong Number of Arguments 0 for 3 when calling partial](https://www.ruby-forum.com/t/wrong-number-of-arguments-0-for-3-when-calling-partial/126858)

<div class="topic-metadata">

**Author:** [@jackster.mobi](https://www.ruby-forum.com/u/jackster.mobi)\
**Replies:** 10\
**Last updated:** [January 24, 2008, 10:13pm UTC](https://www.ruby-forum.com/t/wrong-number-of-arguments-0-for-3-when-calling-partial/126858 "2008-01-24T22:13:55Z")

</div>

I’m hoping someone can help me solve this problem which I believe has to do with my initial configuration of Rails on my server since the simplest of code which calls a partial works on one server but not another. in…

---

## [Custom method on association?](https://www.ruby-forum.com/t/custom-method-on-association/127007)

<div class="topic-metadata">

**Author:** [@daveamos](https://www.ruby-forum.com/u/daveamos)\
**Replies:** 7\
**Last updated:** [January 24, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/custom-method-on-association/127007 "2008-01-24T22:08:23Z")

</div>

Hi, I’m trying to do a custom method, but I get an undefined method error. Here’s what’s happening: \<% @members.each do |member| %\> \<%= member.user.name %\> \<%= member.user.groupwide\_score(@league) %\> \<% end %\> Ca…

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

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