# Rails

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

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

---

## [MVC architecture of ROR](https://www.ruby-forum.com/t/mvc-architecture-of-ror/145709)

<div class="topic-metadata">

**Author:** [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Replies:** 4\
**Last updated:** [August 13, 2008, 11:34am UTC](https://www.ruby-forum.com/t/mvc-architecture-of-ror/145709 "2008-08-13T11:34:51Z")

</div>

Hi, As the ROR follows MVC architecture, then Is it good practice to write queries inside controller? If yes then, For what purpose we are using model? Thanks & Regards, Tushar

---

## [Question on assethost and cross-domain problems](https://www.ruby-forum.com/t/question-on-assethost-and-cross-domain-problems/145716)

<div class="topic-metadata">

**Author:** [@marcw](https://www.ruby-forum.com/u/marcw)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 8:36am UTC](https://www.ruby-forum.com/t/question-on-assethost-and-cross-domain-problems/145716 "2008-08-13T08:36:42Z")

</div>

Hi, I have a rails-system running on swiftiply with 10 mongrels and serving the static data on apache. The swiftiply url is something like “www.example.net”, the asset host is “static.example.net”. In most cases it …

---

## [Howto accept input from a form to a variable (not a database field)](https://www.ruby-forum.com/t/howto-accept-input-from-a-form-to-a-variable-not-a-database-field/145313)

<div class="topic-metadata">

**Author:** [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Replies:** 6\
**Last updated:** [August 13, 2008, 8:29am UTC](https://www.ruby-forum.com/t/howto-accept-input-from-a-form-to-a-variable-not-a-database-field/145313 "2008-08-13T08:29:40Z")

</div>

How do I use a form to capture data for a variable that is no a database field? In the case, I would like to search my database based on the data that the user inputs via a form. Any assistance will be greatly appreci…

---

## [Inter row dependencies in data](https://www.ruby-forum.com/t/inter-row-dependencies-in-data/145708)

<div class="topic-metadata">

**Author:** [@jschank](https://www.ruby-forum.com/u/jschank)\
**Replies:** 5\
**Last updated:** [August 13, 2008, 8:22am UTC](https://www.ruby-forum.com/t/inter-row-dependencies-in-data/145708 "2008-08-13T08:22:04Z")

</div>

Hi there, I want to create a rails app to track vehicle mileage. I figure this would be a good first project to learn how to use rails. But I’m hitting a snag. I want to have a model for refueling events. They’d have…

---

## [Change model definition using scaffold](https://www.ruby-forum.com/t/change-model-definition-using-scaffold/145505)

<div class="topic-metadata">

**Author:** [@Gromski](https://www.ruby-forum.com/u/Gromski)\
**Replies:** 4\
**Last updated:** [August 13, 2008, 4:50am UTC](https://www.ruby-forum.com/t/change-model-definition-using-scaffold/145505 "2008-08-13T04:50:42Z")

</div>

Hi all Apologies if this a trivially newb question but I’m new to rails (and frameworks in general) but is there a way to change the model definition using the scaffold, i.e. is it possible to update the model, views…

---

## [What is the RoR Way for this "find"?](https://www.ruby-forum.com/t/what-is-the-ror-way-for-this-find/145695)

<div class="topic-metadata">

**Author:** [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Replies:** 7\
**Last updated:** [August 13, 2008, 3:26am UTC](https://www.ruby-forum.com/t/what-is-the-ror-way-for-this-find/145695 "2008-08-13T03:26:31Z")

</div>

I have 2 tables that currently are not joined with a has\_many or other relationship. Table 1 has a list of records that are either active or not. Table 2 has the related records with additional data. I need to check…

---

## [URL Decode to XML String](https://www.ruby-forum.com/t/url-decode-to-xml-string/145458)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 3:08am UTC](https://www.ruby-forum.com/t/url-decode-to-xml-string/145458 "2008-08-13T03:08:18Z")

</div>

Does anyone know how to URL decode something to an XML String using Ruby on Rails? I have a url parameter that comes as a string array. I had to split it on a | which was easy. However, I cannot figure out how to UR…

---

## [Restful\_authentication and IE](https://www.ruby-forum.com/t/restful-authentication-and-ie/145696)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 12:56am UTC](https://www.ruby-forum.com/t/restful-authentication-and-ie/145696 "2008-08-13T00:56:27Z")

</div>

Hi all, my Rails app is having a weird, but not uncommon, problem authenticating with IE 6 & 7. I’ve removed web auth and cookie auth from our authenticated\_system.rb. I’ve been reading in related posts that IE sends…

---

## [Remove default value from column on migration](https://www.ruby-forum.com/t/remove-default-value-from-column-on-migration/145592)

<div class="topic-metadata">

**Author:** [@Harold](https://www.ruby-forum.com/u/Harold)\
**Replies:** 2\
**Last updated:** [August 13, 2008, 12:47am UTC](https://www.ruby-forum.com/t/remove-default-value-from-column-on-migration/145592 "2008-08-13T00:47:18Z")

</div>

I need to remove a default value on a PostgreSQL database column in a Rails migration. The table contains a column which is a string with :null =\> true, :default =\> nil. I need to migrate to :null =\> false, but the e…

---

## [Caches\_page issue - seems to be caching but not retrieving!](https://www.ruby-forum.com/t/caches-page-issue-seems-to-be-caching-but-not-retrieving/145692)

<div class="topic-metadata">

**Author:** [@terhorst](https://www.ruby-forum.com/u/terhorst)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 12:19am UTC](https://www.ruby-forum.com/t/caches-page-issue-seems-to-be-caching-but-not-retrieving/145692 "2008-08-13T00:19:29Z")

</div>

Hi all, I’m currently trying to set up caching on my site and am starting by trying to cache my homepage but am having a few problems as although it seems to be caching (in the log I’ve got 'Cached page: /main.html (…

---

## [Dynamic Menu and Session](https://www.ruby-forum.com/t/dynamic-menu-and-session/145682)

<div class="topic-metadata">

**Author:** [@Glen](https://www.ruby-forum.com/u/Glen)\
**Replies:** 1\
**Last updated:** [August 13, 2008, 12:12am UTC](https://www.ruby-forum.com/t/dynamic-menu-and-session/145682 "2008-08-13T00:12:07Z")

</div>

Hi, I am trying to implement dynamic database-driven menu on my web application. Menu is just a set of links to controller actions, but each user has different set of menu items based on their privileges. Menu items…

---

## [Include grouped count in result?](https://www.ruby-forum.com/t/include-grouped-count-in-result/145688)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 0\
**Last updated:** [August 13, 2008, 12:02am UTC](https://www.ruby-forum.com/t/include-grouped-count-in-result/145688 "2008-08-13T00:02:47Z")

</div>

Hi, I am trying to write a method or named\_scope that will return me things based on a grouping… AND I would like to see how many are in that group. I’ve got this: named\_scope :top, :group =\> “view\_type, view\_id”, :o…

---

## [Topic Moving](https://www.ruby-forum.com/t/topic-moving/145550)

<div class="topic-metadata">

**Author:** [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Replies:** 4\
**Last updated:** [August 13, 2008, 12:01am UTC](https://www.ruby-forum.com/t/topic-moving/145550 "2008-08-13T00:01:02Z")

</div>

I’m trying to work out how to move topics from one forum to another. All my code is located here: GitHub - radar/rboard: A fully featured forum system compatible with Rails 2.3 It just doesn’t seem to be updating last\_…

---

## [How to capitalize UTF8 string without downcasing](https://www.ruby-forum.com/t/how-to-capitalize-utf8-string-without-downcasing/132475)

<div class="topic-metadata">

**Author:** [@janfoeh](https://www.ruby-forum.com/u/janfoeh)\
**Replies:** 2\
**Last updated:** [August 12, 2008, 11:34pm UTC](https://www.ruby-forum.com/t/how-to-capitalize-utf8-string-without-downcasing/132475 "2008-08-12T23:34:39Z")

</div>

What is the best way to capitalize the first character of a UTF8 string? String#capitalize downcases the rest of the string which is unacceptable since there can be capitals in the middle of the string. (“see New York…

---

## [Need some help with a quick ruby/rails job?](https://www.ruby-forum.com/t/need-some-help-with-a-quick-ruby-rails-job/145683)

<div class="topic-metadata">

**Author:** [@stenzer](https://www.ruby-forum.com/u/stenzer)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/need-some-help-with-a-quick-ruby-rails-job/145683 "2008-08-12T22:54:14Z")

</div>

Experienced ruby/rails programmer (ex-smalltalker) with about 10 deployed rails sites would like to generate some additional income - does anyone need someone to work (fast and hard) on a project right away? Located i…

---

## [Link\_to](https://www.ruby-forum.com/t/link-to/145601)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 1\
**Last updated:** [August 12, 2008, 10:42pm UTC](https://www.ruby-forum.com/t/link-to/145601 "2008-08-12T22:42:00Z")

</div>

Hi, I guess my question is: how can I pass an array as a parameter with link\_to. Just say in index action: @stuff = Model.find(:all) Then in view I have: link\_to and pass the whole array @stuff to the next action. T…

---

## [Help belongs\_to\_auto\_completer model\_auto\_completer](https://www.ruby-forum.com/t/help-belongs-to-auto-completer-model-auto-completer/145684)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/help-belongs-to-auto-completer-model-auto-completer/145684 "2008-08-12T22:18:50Z")

</div>

hi, im trying to integrate model\_auto\_completer. the dropdown is working nicely, my userdefined function: auto\_complete\_belongs\_to\_for\_X\_Y\_Z works as well, but then im stuck. via model\_auto\_completer\_result i can see…

---

## [Developing a Rails server on XP](https://www.ruby-forum.com/t/developing-a-rails-server-on-xp/145450)

<div class="topic-metadata">

**Author:** [@athel](https://www.ruby-forum.com/u/athel)\
**Replies:** 5\
**Last updated:** [August 12, 2008, 10:17pm UTC](https://www.ruby-forum.com/t/developing-a-rails-server-on-xp/145450 "2008-08-12T22:17:57Z")

</div>

I followed the following site step by step: http://wiki.rubyonrails.org/rails/pages/Fast+CGI+and+Apache2+for+Windows+XP In the past this worked perfect. However, this weekend I started rebuilding a rails server. I c…

---

## [Collection\_select with params :onchange](https://www.ruby-forum.com/t/collection-select-with-params-onchange/145584)

<div class="topic-metadata">

**Author:** [@maite](https://www.ruby-forum.com/u/maite)\
**Replies:** 3\
**Last updated:** [August 12, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/collection-select-with-params-onchange/145584 "2008-08-12T21:52:42Z")

</div>

hello list this my code \<%= collection\_select (“fuentes”, “id”, @fuente, :id, :nombre, {:prompt =\> ‘Seleccione mercado’}, :onchange=\> {"$(‘btn4’).visualEffect(‘Appear’)"})%\> \<%= submit\_tag "Crear url…

---

## [Optimizing find on join table](https://www.ruby-forum.com/t/optimizing-find-on-join-table/145602)

<div class="topic-metadata">

**Author:** [@rsoerensen](https://www.ruby-forum.com/u/rsoerensen)\
**Replies:** 1\
**Last updated:** [August 12, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/optimizing-find-on-join-table/145602 "2008-08-12T21:52:42Z")

</div>

Hi, I have a application where i want to rank players according to the goals they have scored. I can actually make the ranking work, but I have performance problems when I try to fetch the total opponent score (goals …

---

## [Wiping the database?](https://www.ruby-forum.com/t/wiping-the-database/145466)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [August 12, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/wiping-the-database/145466 "2008-08-12T21:50:56Z")

</div>

Does rails have a built in function that wipes (erases everything) in the database? Something like rake db:purge?

---

## [Problems when using conditions in find Rails 2.1.0](https://www.ruby-forum.com/t/problems-when-using-conditions-in-find-rails-2-1-0/145680)

<div class="topic-metadata">

**Author:** [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/problems-when-using-conditions-in-find-rails-2-1-0/145680 "2008-08-12T21:43:58Z")

</div>

Never had this issue before updating to Rails 2.1.0. Now for some reason the condition clause is used with an array is not working. I’ve been trying use work arounds but I can’t figure it out. Please anyone HELP!!! Q…

---

## [Why is "valid\_numericality\_of" executed when value is empty?](https://www.ruby-forum.com/t/why-is-valid-numericality-of-executed-when-value-is-empty/145670)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 1\
**Last updated:** [August 12, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/why-is-valid-numericality-of-executed-when-value-is-empty/145670 "2008-08-12T21:04:49Z")

</div>

Hi all I’m wondering why validates\_numericality\_of :xxx is executed also when xxx is left empty? Shouldn’t it just be disabled in this case? validates\_numericality\_of :xxx, :if =\> Proc.new { |obj| obj.xxx } …looks…

---

## [Upload Script](https://www.ruby-forum.com/t/upload-script/145674)

<div class="topic-metadata">

**Author:** [@chaosbanane](https://www.ruby-forum.com/u/chaosbanane)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/upload-script/145674 "2008-08-12T20:56:34Z")

</div>

Hi I dont get any uploadscript to work with ruby. Ajax, php, nothing works. Somebody have a tutoriallink or better a working script? Thanks Andi

---

## [Form.select: always show :prompt value?](https://www.ruby-forum.com/t/form-select-always-show-prompt-value/145669)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 6:59pm UTC](https://www.ruby-forum.com/t/form-select-always-show-prompt-value/145669 "2008-08-12T18:59:32Z")

</div>

Hi all Normally I find it very practical that the :prompt value is not shown anymore as soon as the user has selected a value from the option list and then submits the form and it is re-displayed because of an error o…

---

## [Inconsistency between association and send(method)](https://www.ruby-forum.com/t/inconsistency-between-association-and-send-method/145612)

<div class="topic-metadata">

**Author:** [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Replies:** 1\
**Last updated:** [August 12, 2008, 6:26pm UTC](https://www.ruby-forum.com/t/inconsistency-between-association-and-send-method/145612 "2008-08-12T18:26:39Z")

</div>

I’m working on a generic method to display conflicting values when there is a concurrency violation using the optimistic locking mechanism in Rails (lock\_version and StaleObjectError). When a user submits a form and t…

---

## [Problems with gd2](https://www.ruby-forum.com/t/problems-with-gd2/145665)

<div class="topic-metadata">

**Author:** [@chen](https://www.ruby-forum.com/u/chen)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/problems-with-gd2/145665 "2008-08-12T18:20:51Z")

</div>

Hi! I’ve installed gd2 on my server (Debian), and I’ve installed the gd2 gem, but i got this problem: rake db:schema:dump --trace (in /var/rails/feevy2) \*\* Invoke db:schema:dump (first\_time) \*\* Invoke environment (…

---

## [Order + find query](https://www.ruby-forum.com/t/order-find-query/145623)

<div class="topic-metadata">

**Author:** [@prionko](https://www.ruby-forum.com/u/prionko)\
**Replies:** 2\
**Last updated:** [August 12, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/order-find-query/145623 "2008-08-12T16:49:37Z")

</div>

Hi, I have got a table which has many field, one of them is updated\_at. Can anybody tell me how to get the value of a row which has been updated recently. -Thanks Saurav

---

## [ActiveRecord find with expressions using fields](https://www.ruby-forum.com/t/activerecord-find-with-expressions-using-fields/145651)

<div class="topic-metadata">

**Author:** [@pedz](https://www.ruby-forum.com/u/pedz)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/activerecord-find-with-expressions-using-fields/145651 "2008-08-12T16:07:14Z")

</div>

Suppose I have a table with two fields “a” and “b” – both integers. I want to do: select \* from mytable where a + b \> 18 I understand that I can pass :conditions a string but that has a few limitations. If I want m…

---

## [Error message in another controller](https://www.ruby-forum.com/t/error-message-in-another-controller/145649)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 0\
**Last updated:** [August 12, 2008, 3:45pm UTC](https://www.ruby-forum.com/t/error-message-in-another-controller/145649 "2008-08-12T15:45:47Z")

</div>

Can I use error\_messages\_for in another controller/view?

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

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