# Rails

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

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

---

## [Best way to do model validation and pass errors?](https://www.ruby-forum.com/t/best-way-to-do-model-validation-and-pass-errors/161688)

<div class="topic-metadata">

**Author:** [@openmind](https://www.ruby-forum.com/u/openmind)\
**Replies:** 0\
**Last updated:** [March 1, 2009, 12:15am UTC](https://www.ruby-forum.com/t/best-way-to-do-model-validation-and-pass-errors/161688 "2009-03-01T00:15:34Z")

</div>

Hi all, Following up on the best practices series, what is the best way to do some more advanced model validation, beyond presence, numericality, etc. For example, I want to do some checks on the database to see if a …

---

## [Rails related Ruby question](https://www.ruby-forum.com/t/rails-related-ruby-question/161677)

<div class="topic-metadata">

**Author:** [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Replies:** 2\
**Last updated:** [March 1, 2009, 12:05am UTC](https://www.ruby-forum.com/t/rails-related-ruby-question/161677 "2009-03-01T00:05:16Z")

</div>

I’m doing an app that has a very frequent need to compare dates. My code is littered with things like: return if foo.date \< 10.days.ago Each and every time I do one of these I have to stop and think it through to ge…

---

## [Missing Template](https://www.ruby-forum.com/t/missing-template/161652)

<div class="topic-metadata">

**Author:** [@Shelly](https://www.ruby-forum.com/u/Shelly)\
**Replies:** 3\
**Last updated:** [February 28, 2009, 11:52pm UTC](https://www.ruby-forum.com/t/missing-template/161652 "2009-02-28T23:52:32Z")

</div>

Hi, I am trying to create a hello world application, where the controller (Say) only has one action: def hello end And the view, hello.rhtml, has HELLO WORLD. When I run it, it says Missing template say/hello.htm…

---

## [Page was generated in 0. XXX seconds](https://www.ruby-forum.com/t/page-was-generated-in-0-xxx-seconds/161684)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/page-was-generated-in-0-xxx-seconds/161684 "2009-02-28T23:04:31Z")

</div>

How can I add a “Page was generated in 0.XXX seconds” counter to page?

---

## [Beginners question](https://www.ruby-forum.com/t/beginners-question/161433)

<div class="topic-metadata">

**Author:** [@ruud](https://www.ruby-forum.com/u/ruud)\
**Replies:** 8\
**Last updated:** [February 28, 2009, 10:19pm UTC](https://www.ruby-forum.com/t/beginners-question/161433 "2009-02-28T22:19:47Z")

</div>

hi group, I am making a little rails app to experiment with rails. It consists of one model, item, that represents an item on a todo list. A todo item has a description, a state (finished or not) and a due date. Aft…

---

## [Passing blocks to partials](https://www.ruby-forum.com/t/passing-blocks-to-partials/161674)

<div class="topic-metadata">

**Author:** [@stevo84](https://www.ruby-forum.com/u/stevo84)\
**Replies:** 1\
**Last updated:** [February 28, 2009, 9:58pm UTC](https://www.ruby-forum.com/t/passing-blocks-to-partials/161674 "2009-02-28T21:58:40Z")

</div>

Hi I’ve got following problem: I am attempting to write helper that will display table (stored in partial) with some custom last column contents. I would like to call it like \<% parametrized\_users\_list(@users) do |u…

---

## [Linking to an external model/view within an application](https://www.ruby-forum.com/t/linking-to-an-external-model-view-within-an-application/161669)

<div class="topic-metadata">

**Author:** [@jimmypalmer](https://www.ruby-forum.com/u/jimmypalmer)\
**Replies:** 2\
**Last updated:** [February 28, 2009, 9:23pm UTC](https://www.ruby-forum.com/t/linking-to-an-external-model-view-within-an-application/161669 "2009-02-28T21:23:49Z")

</div>

Hey guys, I am working on a class project and I have two scaffolded models, articles and sub\_articles. I have the relationships set to articles having many sub\_articles and sub\_articles belonging to articles, which i…

---

## [Link to public folder for attachments](https://www.ruby-forum.com/t/link-to-public-folder-for-attachments/161670)

<div class="topic-metadata">

**Author:** [@eyal](https://www.ruby-forum.com/u/eyal)\
**Replies:** 2\
**Last updated:** [February 28, 2009, 8:53pm UTC](https://www.ruby-forum.com/t/link-to-public-folder-for-attachments/161670 "2009-02-28T20:53:58Z")

</div>

Hello. In the directory that holds my site example.com, I have a symlink from example.com/html/backend to the public folder in my rails application. That public folder holds a folder called uploads which contains att…

---

## [Two belongs\_to relationships in one model?](https://www.ruby-forum.com/t/two-belongs-to-relationships-in-one-model/161656)

<div class="topic-metadata">

**Author:** [@jcernelli](https://www.ruby-forum.com/u/jcernelli)\
**Replies:** 11\
**Last updated:** [February 28, 2009, 8:07pm UTC](https://www.ruby-forum.com/t/two-belongs-to-relationships-in-one-model/161656 "2009-02-28T20:07:31Z")

</div>

Hi everyone! I’m new to ror, and i’m stuck with what might be kind of a beginners problem. Here’s a brief description of what i’m trying to do: I have two classes, lets say Class\_a and Class\_b, with their models “ha…

---

## [Rest-ish method for subsetting an index view?](https://www.ruby-forum.com/t/rest-ish-method-for-subsetting-an-index-view/161623)

<div class="topic-metadata">

**Author:** [@rpardee](https://www.ruby-forum.com/u/rpardee)\
**Replies:** 1\
**Last updated:** [February 28, 2009, 7:11pm UTC](https://www.ruby-forum.com/t/rest-ish-method-for-subsetting-an-index-view/161623 "2009-02-28T19:11:11Z")

</div>

Hey All, My app keeps track of /people. A Person has a .typical\_role property, which (right now) takes one of the following values: \[“Programmer”, “Investigator”, “Project Manager”, “Other”\]. What’s the best/easiest…

---

## [Polymorphic association..explain the extra query?](https://www.ruby-forum.com/t/polymorphic-association-explain-the-extra-query/161600)

<div class="topic-metadata">

**Author:** [@arpit](https://www.ruby-forum.com/u/arpit)\
**Replies:** 5\
**Last updated:** [February 28, 2009, 6:22pm UTC](https://www.ruby-forum.com/t/polymorphic-association-explain-the-extra-query/161600 "2009-02-28T18:22:30Z")

</div>

Can anyone explain to me the sql query done in the last step : http://pastie.org/402200 – Arpit J.

---

## [Launching First Rails Website](https://www.ruby-forum.com/t/launching-first-rails-website/161663)

<div class="topic-metadata">

**Author:** [@semyou](https://www.ruby-forum.com/u/semyou)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/launching-first-rails-website/161663 "2009-02-28T17:17:34Z")

</div>

Hi fellows, I am planning to launch my first website, Web2.0 style. I have some questions for you: Do I have to register a business name before being able to receive money from my website? If I need to create a …

---

## [Simple Display of Cucumber Results in Web Page?](https://www.ruby-forum.com/t/simple-display-of-cucumber-results-in-web-page/161660)

<div class="topic-metadata">

**Author:** [@blacknight](https://www.ruby-forum.com/u/blacknight)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/simple-display-of-cucumber-results-in-web-page/161660 "2009-02-28T16:46:46Z")

</div>

I’m looking for a simple way to display Cucumber features and test results on a web page. I found rcucumber1, which also allows users to write their own tests. I was hoping there would be something with lower overhead…

---

## [How DRY is too DRY?](https://www.ruby-forum.com/t/how-dry-is-too-dry/161635)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 11\
**Last updated:** [February 28, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/how-dry-is-too-dry/161635 "2009-02-28T14:41:39Z")

</div>

I’m working on fixing up the code in my first Rails application and have come around to DRYing up the views and partials. For the most part, I’m satisfied with the DRYness of the application, but I have 5-6 partials …

---

## [Has\_many :through, expects "through" model to be belongs\_to](https://www.ruby-forum.com/t/has-many-through-expects-through-model-to-be-belongs-to/161639)

<div class="topic-metadata">

**Author:** [@preethi](https://www.ruby-forum.com/u/preethi)\
**Replies:** 3\
**Last updated:** [February 28, 2009, 11:38am UTC](https://www.ruby-forum.com/t/has-many-through-expects-through-model-to-be-belongs-to/161639 "2009-02-28T11:38:20Z")

</div>

Hi, I’m using has\_many and through relationship between two models Profile and User Profile.rb has\_and\_belongs\_to\_many :users belongs\_to :community User.rb has\_and\_belongs\_to\_many :profiles has\_many :communities, :…

---

## [File\_column quality problem](https://www.ruby-forum.com/t/file-column-quality-problem/161650)

<div class="topic-metadata">

**Author:** [@aldoitalo](https://www.ruby-forum.com/u/aldoitalo)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 11:26am UTC](https://www.ruby-forum.com/t/file-column-quality-problem/161650 "2009-02-28T11:26:42Z")

</div>

i usising file\_column to upload images in my scaffold. i setting quality compression images to value 70 for creating various versions optimized of uploaded image: example of my code: file\_column :image\_url, :magick =\>…

---

## [Cleaning up HTML markup from external sources](https://www.ruby-forum.com/t/cleaning-up-html-markup-from-external-sources/161643)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 9:10am UTC](https://www.ruby-forum.com/t/cleaning-up-html-markup-from-external-sources/161643 "2009-02-28T09:10:14Z")

</div>

I’m using acts\_as\_amazon\_product to pull content about books I own. This makes it very easy for me to pull down lots of data about books I own without having to enter all that stuff myself. It even includes a descript…

---

## [Has\_many :through, expects "through" model to be belongs\_to](https://www.ruby-forum.com/t/has-many-through-expects-through-model-to-be-belongs-to/161640)

<div class="topic-metadata">

**Author:** [@preethi](https://www.ruby-forum.com/u/preethi)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 7:20am UTC](https://www.ruby-forum.com/t/has-many-through-expects-through-model-to-be-belongs-to/161640 "2009-02-28T07:20:46Z")

</div>

Hi, I’m using has\_many and through relationship between two models Profile and User Profile.rb has\_and\_belongs\_to\_many :users belongs\_to :community User.rb has\_and\_belongs\_to\_many :profiles has\_many :communities, :…

---

## [Polymorphic hm=\>t](https://www.ruby-forum.com/t/polymorphic-hm-t/161638)

<div class="topic-metadata">

**Author:** [@juli](https://www.ruby-forum.com/u/juli)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 5:31am UTC](https://www.ruby-forum.com/t/polymorphic-hm-t/161638 "2009-02-28T05:31:06Z")

</div>

Hi, I have the following class architecture: class Container \< ActiveRecord::Base has\_many :containments, :order =\> ‘position’ has\_many :parent\_containments, :as =\> :containable, :class\_name =\> ‘Containment’ has\_ma…

---

## [Associating ActiveRecord and non-ActiveRecord objects](https://www.ruby-forum.com/t/associating-activerecord-and-non-activerecord-objects/161637)

<div class="topic-metadata">

**Author:** [@evan](https://www.ruby-forum.com/u/evan)\
**Replies:** 1\
**Last updated:** [February 28, 2009, 3:37am UTC](https://www.ruby-forum.com/t/associating-activerecord-and-non-activerecord-objects/161637 "2009-02-28T03:37:37Z")

</div>

Is it possible to define a model that is not backed by a database table and still relate other models to it? Will relations between instances of these models persist? For instance, say I have a Cat model that does not…

---

## [Rails Music Composer](https://www.ruby-forum.com/t/rails-music-composer/161634)

<div class="topic-metadata">

**Author:** [@GabrielG1976](https://www.ruby-forum.com/u/GabrielG1976)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 3:20am UTC](https://www.ruby-forum.com/t/rails-music-composer/161634 "2009-02-28T03:20:03Z")

</div>

Hello everyone i have created a online Music composer that built in rails I was wondering what others in the communty think about it www.literature2music.com thanks for the feedback Gabrielg1976

---

## [What / when calls create function in an ActionController?](https://www.ruby-forum.com/t/what-when-calls-create-function-in-an-actioncontroller/161578)

<div class="topic-metadata">

**Author:** [@SSZSmSS](https://www.ruby-forum.com/u/SSZSmSS)\
**Replies:** 5\
**Last updated:** [February 28, 2009, 2:32am UTC](https://www.ruby-forum.com/t/what-when-calls-create-function-in-an-actioncontroller/161578 "2009-02-28T02:32:36Z")

</div>

Hi friends , i am newbie and was trying to learn rails by following a tutorial which uses attachment\_fu to upload videos .! every thing was working till i edited something somewhere ! the problem is that nothing happ…

---

## [Activerecord-odbc-adapter 2.0 failed to allocate memory](https://www.ruby-forum.com/t/activerecord-odbc-adapter-2-0-failed-to-allocate-memory/161630)

<div class="topic-metadata">

**Author:** [@Seyit\_Caglar\_Abbaso](https://www.ruby-forum.com/u/Seyit_Caglar_Abbaso)\
**Replies:** 0\
**Last updated:** [February 28, 2009, 1:49am UTC](https://www.ruby-forum.com/t/activerecord-odbc-adapter-2-0-failed-to-allocate-memory/161630 "2009-02-28T01:49:53Z")

</div>

I’m currently trying to connect rails to a legacy SqlServer database. System is windows XP and my attempts to connect with activerecord sql adapter and ADO.rb file failed miserably (I wrote a mail about it before) S…

---

## [Help with rails on mac](https://www.ruby-forum.com/t/help-with-rails-on-mac/161627)

<div class="topic-metadata">

**Author:** [@jstark](https://www.ruby-forum.com/u/jstark)\
**Replies:** 2\
**Last updated:** [February 28, 2009, 1:41am UTC](https://www.ruby-forum.com/t/help-with-rails-on-mac/161627 "2009-02-28T01:41:05Z")

</div>

Hello, i am running OSX 10.5 leopard with installed rails 2.2.2 at / usr/bin/. Having wanted to try rails 2.3, i created a gems directory at $HOME/gems and used ‘export GEM\_HOME=$HOME/gems’. Then i gave a 'gem install…

---

## [Authorization system recommendations](https://www.ruby-forum.com/t/authorization-system-recommendations/161599)

<div class="topic-metadata">

**Author:** [@evan](https://www.ruby-forum.com/u/evan)\
**Replies:** 2\
**Last updated:** [February 28, 2009, 12:16am UTC](https://www.ruby-forum.com/t/authorization-system-recommendations/161599 "2009-02-28T00:16:49Z")

</div>

Good morning. Our application has grown to the point where a more robust authorization system is needed. What Rails plugins or Ruby gems do you recommend? Our needs include: defining multiple user roles which can u…

---

## [Is a global set of named\_scope scopes a bad idea? If not, is it possible?](https://www.ruby-forum.com/t/is-a-global-set-of-named-scope-scopes-a-bad-idea-if-not-is-it-possible/161619)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 2\
**Last updated:** [February 27, 2009, 11:24pm UTC](https://www.ruby-forum.com/t/is-a-global-set-of-named-scope-scopes-a-bad-idea-if-not-is-it-possible/161619 "2009-02-27T23:24:02Z")

</div>

I’ve noticed that several of my models contain the same set of named\_scopes (ones for active, various access levels, etc.). I was thinking to avoid the duplication I’d try to pull that coat into a common file either …

---

## [Dissabled text field but still post its value on submit](https://www.ruby-forum.com/t/dissabled-text-field-but-still-post-its-value-on-submit/161618)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 2\
**Last updated:** [February 27, 2009, 10:22pm UTC](https://www.ruby-forum.com/t/dissabled-text-field-but-still-post-its-value-on-submit/161618 "2009-02-27T22:22:22Z")

</div>

Hi, I have a text field that gets its updated value from a javascript function. So I don’t want the user to enter anything into the field. But I want the value to be part of the parameters when the form is submitted. …

---

## [SQL search](https://www.ruby-forum.com/t/sql-search/161590)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 6\
**Last updated:** [February 27, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/sql-search/161590 "2009-02-27T22:11:18Z")

</div>

How I write it in rails format? Articles.find( ???) SELECT \*, MATCH(title, body) AGAINST(’$keyword’) AS score FROM articles WHERE MATCH(title, body) AGAINST(’$keyword’) ORDER BY score DESC

---

## [Can't find gems in /vendor/gems/ after modifying load\_paths](https://www.ruby-forum.com/t/cant-find-gems-in-vendor-gems-after-modifying-load-paths/160279)

<div class="topic-metadata">

**Author:** [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Replies:** 6\
**Last updated:** [February 27, 2009, 9:58pm UTC](https://www.ruby-forum.com/t/cant-find-gems-in-vendor-gems-after-modifying-load-paths/160279 "2009-02-27T21:58:22Z")

</div>

I’m picking up a Rails app that is using a lot of older gems. We’re using Rails 2.0.2 and planning to move to to Rails 2.3 along with upgrading the the dependencies. However, in the meantime, we’re moving servers ar…

---

## [Advise request: plugin routes with version prefix](https://www.ruby-forum.com/t/advise-request-plugin-routes-with-version-prefix/160458)

<div class="topic-metadata">

**Author:** [@raphael\_b](https://www.ruby-forum.com/u/raphael_b)\
**Replies:** 1\
**Last updated:** [February 27, 2009, 9:42pm UTC](https://www.ruby-forum.com/t/advise-request-plugin-routes-with-version-prefix/160458 "2009-02-27T21:42:27Z")

</div>

Hi, I’m developing an API as a rails plugin, and I would like to be able to install multiple versions in parallel. The routing is not a big problem, I can define routes with the correct prefix. The problem would be w…

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

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