# Rails

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

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

---

## [Retrieving text from a query fired in Rails](https://www.ruby-forum.com/t/retrieving-text-from-a-query-fired-in-rails/104852)

<div class="topic-metadata">

**Author:** [@Aman\_Thind](https://www.ruby-forum.com/u/Aman_Thind)\
**Replies:** 1\
**Last updated:** [May 23, 2007, 7:59am UTC](https://www.ruby-forum.com/t/retrieving-text-from-a-query-fired-in-rails/104852 "2007-05-23T07:59:11Z")

</div>

Hello, I have a query that returns a number and I want to use that number after that. Could you please let me know how to access the data. I fire the query like: numscens = Progression.find\_by\_sql(“select numscenari…

---

## [Using data from results of a query](https://www.ruby-forum.com/t/using-data-from-results-of-a-query/104853)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 23, 2007, 7:53am UTC](https://www.ruby-forum.com/t/using-data-from-results-of-a-query/104853 "2007-05-23T07:53:11Z")

</div>

Hello, I have a query that returns a number and I want to use that number after that. Could you please let me know how to access the data. I fire the query like: numscens = Progression.find\_by\_sql(“select numscenari…

---

## [Rails or ASP.NET](https://www.ruby-forum.com/t/rails-or-asp-net/104777)

<div class="topic-metadata">

**Author:** [@sandeepcampbell](https://www.ruby-forum.com/u/sandeepcampbell)\
**Replies:** 16\
**Last updated:** [May 23, 2007, 7:41am UTC](https://www.ruby-forum.com/t/rails-or-asp-net/104777 "2007-05-23T07:41:10Z")

</div>

Hi I have to do a Video streaming website and I would like to know what would be BETTER to use ROR or ASP.NET? Which would give better performance on same hardware? Regards Sandeep

---

## [Any ideas why Rails hangs intermittently?](https://www.ruby-forum.com/t/any-ideas-why-rails-hangs-intermittently/104799)

<div class="topic-metadata">

**Author:** [@acarlos](https://www.ruby-forum.com/u/acarlos)\
**Replies:** 1\
**Last updated:** [May 23, 2007, 7:36am UTC](https://www.ruby-forum.com/t/any-ideas-why-rails-hangs-intermittently/104799 "2007-05-23T07:36:10Z")

</div>

Hello, I’m stumped. I have a Rails app that seemingly hangs at random times. I am the only user, but my non-optimized application loads a lot of objects (around a thousand) for some report views. Sometimes everything…

---

## [Rails Plugins](https://www.ruby-forum.com/t/rails-plugins/104347)

<div class="topic-metadata">

**Author:** [@Zach\_ISSS\_LT3media](https://www.ruby-forum.com/u/Zach_ISSS_LT3media)\
**Replies:** 2\
**Last updated:** [May 23, 2007, 7:18am UTC](https://www.ruby-forum.com/t/rails-plugins/104347 "2007-05-23T07:18:09Z")

</div>

Hey, Trying to get my plugin out there a bit more? I’ve put my SVN and latest plugin url ( http://zachinglis.com/2007/coding/rails- plugins/ ) on the wiki, How else would you suggest doing it?

---

## [Validation date](https://www.ruby-forum.com/t/validation-date/104781)

<div class="topic-metadata">

**Author:** [@alabama](https://www.ruby-forum.com/u/alabama)\
**Replies:** 2\
**Last updated:** [May 23, 2007, 6:54am UTC](https://www.ruby-forum.com/t/validation-date/104781 "2007-05-23T06:54:07Z")

</div>

Hi everybody ! I can’t find validation for date. In my form I use form.date\_select. How I can protect this field from selection for egzample “month-\> February, day -\> 30”. ActiveRecord don’t save it, but error will …

---

## [Rails way for creating "sorry no page found" for bad urls?](https://www.ruby-forum.com/t/rails-way-for-creating-sorry-no-page-found-for-bad-urls/104847)

<div class="topic-metadata">

**Author:** [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Replies:** 1\
**Last updated:** [May 23, 2007, 6:15am UTC](https://www.ruby-forum.com/t/rails-way-for-creating-sorry-no-page-found-for-bad-urls/104847 "2007-05-23T06:15:39Z")

</div>

hi, other than brute forcing my way in creating render =\> ‘no page found’ for every action that returns a nil variable, is there a rails way to creating a no page found for when someone decided to try random urls? th…

---

## [Alphabetical view of posts](https://www.ruby-forum.com/t/alphabetical-view-of-posts/104733)

<div class="topic-metadata">

**Author:** [@raj](https://www.ruby-forum.com/u/raj)\
**Replies:** 8\
**Last updated:** [May 23, 2007, 6:05am UTC](https://www.ruby-forum.com/t/alphabetical-view-of-posts/104733 "2007-05-23T06:05:04Z")

</div>

How to show blog post in alphabetical order. Thank you. PS: New to rails and web.

---

## [Combining has\_many :through and polymorphic associations](https://www.ruby-forum.com/t/combining-has-many-through-and-polymorphic-associations/104844)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 0\
**Last updated:** [May 23, 2007, 4:59am UTC](https://www.ruby-forum.com/t/combining-has-many-through-and-polymorphic-associations/104844 "2007-05-23T04:59:59Z")

</div>

I’m trying to combine has\_many :through and polymorphic associations. I’ve got it working one way but the other way it fails. Here’s the domain I’m trying to model: I’ve got a number of different authorable objects in…

---

## [User id's - best practice - apache2 + mongrel\_cluster + capi](https://www.ruby-forum.com/t/user-ids-best-practice-apache2-mongrel-cluster-capi/104835)

<div class="topic-metadata">

**Author:** [@Scott\_Eckenrode](https://www.ruby-forum.com/u/Scott_Eckenrode)\
**Replies:** 0\
**Last updated:** [May 23, 2007, 3:36am UTC](https://www.ruby-forum.com/t/user-ids-best-practice-apache2-mongrel-cluster-capi/104835 "2007-05-23T03:36:53Z")

</div>

I am looking for a best practice as far as setting up a deployment user goes. I have 3 boxes - development, svn, production and have setup a common deployment user for all 3 boxes (same user). I’m using ssh key acces…

---

## [Local SVN & Capistrano 2.0](https://www.ruby-forum.com/t/local-svn-capistrano-2-0/104750)

<div class="topic-metadata">

**Author:** [@seanstewart](https://www.ruby-forum.com/u/seanstewart)\
**Replies:** 2\
**Last updated:** [May 23, 2007, 2:41am UTC](https://www.ruby-forum.com/t/local-svn-capistrano-2-0/104750 "2007-05-23T02:41:50Z")

</div>

Everything is working well in my svn repository. I am able to connect to my server by using “cap deploy”, but receive this error message: \*\* \[out\] svn: Unable to open an ra\_local session to URL \*\* svn: Unable to open…

---

## [Trimming the text](https://www.ruby-forum.com/t/trimming-the-text/104747)

<div class="topic-metadata">

**Author:** [@raj](https://www.ruby-forum.com/u/raj)\
**Replies:** 3\
**Last updated:** [May 23, 2007, 2:21am UTC](https://www.ruby-forum.com/t/trimming-the-text/104747 "2007-05-23T02:21:49Z")

</div>

I have to display a post but i want to display only 3 lines of it…I want to trim the text and put read more link. How do i do that? Thank you. PS: New Bee to rails.

---

## [Sending parameters from view to method in controller](https://www.ruby-forum.com/t/sending-parameters-from-view-to-method-in-controller/104821)

<div class="topic-metadata">

**Author:** [@raj\_ma](https://www.ruby-forum.com/u/raj_ma)\
**Replies:** 1\
**Last updated:** [May 23, 2007, 2:02am UTC](https://www.ruby-forum.com/t/sending-parameters-from-view-to-method-in-controller/104821 "2007-05-23T02:02:47Z")

</div>

this my show method def showa @posts=Post.find(:all, :conditions =\> “title LIKE ‘a%’”, :order=\> “id DESC”) render :action =\> ‘list’ end This is my view stmt \<%= link\_to ‘A’, :action =\> ‘showa’ %\> I want to send A…

---

## [Collecting data from many instance of same field](https://www.ruby-forum.com/t/collecting-data-from-many-instance-of-same-field/104800)

<div class="topic-metadata">

**Author:** [@Mario\_TSL](https://www.ruby-forum.com/u/Mario_TSL)\
**Replies:** 2\
**Last updated:** [May 23, 2007, 12:36am UTC](https://www.ruby-forum.com/t/collecting-data-from-many-instance-of-same-field/104800 "2007-05-23T00:36:52Z")

</div>

How do I format a view to handle multiple instances of the same field. For example, I want to send an email to several recipients. I list the same field 5 times: Email: \<%= text\_field 'invitation', 'recipient\_email',…

---

## [Unable to use gem cleanup on ubuntu feisty](https://www.ruby-forum.com/t/unable-to-use-gem-cleanup-on-ubuntu-feisty/104403)

<div class="topic-metadata">

**Author:** [@vince](https://www.ruby-forum.com/u/vince)\
**Replies:** 3\
**Last updated:** [May 23, 2007, 12:25am UTC](https://www.ruby-forum.com/t/unable-to-use-gem-cleanup-on-ubuntu-feisty/104403 "2007-05-23T00:25:40Z")

</div>

anyone else having this problem? i got the same error on two clean installs. it@T43:~$ ruby --version ruby 1.8.5 (2006-08-25) \[i486-linux\] it@T43:~$ rails --version Rails 1.2.3 it@T43:~$ gem --version 0.9.3 it@…

---

## [Find\_by\_sql returning nothing](https://www.ruby-forum.com/t/find-by-sql-returning-nothing/104823)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 1\
**Last updated:** [May 22, 2007, 11:53pm UTC](https://www.ruby-forum.com/t/find-by-sql-returning-nothing/104823 "2007-05-22T23:53:11Z")

</div>

I have a rather long query I’m passing into find\_by\_sql, but it doesn’t return anything. However, when I pull the Rails generated SQL from the log file and throw it into my db console (psql on Postgres), I do get res…

---

## [Using multiple mysql databases](https://www.ruby-forum.com/t/using-multiple-mysql-databases/104825)

<div class="topic-metadata">

**Author:** [@kevin\_ySkim](https://www.ruby-forum.com/u/kevin_ySkim)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 11:45pm UTC](https://www.ruby-forum.com/t/using-multiple-mysql-databases/104825 "2007-05-22T23:45:36Z")

</div>

Hi, I’ve got an app that talks to two databases on a given MySQL server. When I run in development mode, pointing to the MySQL server running on localhost (127.0.0.1), I am able to access both databases without any p…

---

## [Project Guidance for Youth Center Survey](https://www.ruby-forum.com/t/project-guidance-for-youth-center-survey/104728)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [May 22, 2007, 11:45pm UTC](https://www.ruby-forum.com/t/project-guidance-for-youth-center-survey/104728 "2007-05-22T23:45:36Z")

</div>

Hello, I am excited to be learning Ruby on Rails! I have no prior programming knowledge or experience, but I was able to follow the examples in a couple of books and get most of the same outcomes that were illustrate…

---

## [Rails API is not well defined](https://www.ruby-forum.com/t/rails-api-is-not-well-defined/104819)

<div class="topic-metadata">

**Author:** [@Mario\_TSL](https://www.ruby-forum.com/u/Mario_TSL)\
**Replies:** 4\
**Last updated:** [May 22, 2007, 11:29pm UTC](https://www.ruby-forum.com/t/rails-api-is-not-well-defined/104819 "2007-05-22T23:29:50Z")

</div>

Although somewhat new, I continue to struggle with passing the right parameters to the Rails methods despite making direct reference to the documentation. For example, I want to create a form: form\_tag :action =\> ‘d…

---

## [Sms marketing mobile cell pakistan karachi islamabad lahore](https://www.ruby-forum.com/t/sms-marketing-mobile-cell-pakistan-karachi-islamabad-lahore/104820)

<div class="topic-metadata">

**Author:** [@koom2020](https://www.ruby-forum.com/u/koom2020)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 10:22pm UTC](https://www.ruby-forum.com/t/sms-marketing-mobile-cell-pakistan-karachi-islamabad-lahore/104820 "2007-05-22T22:22:29Z")

</div>

SMS ur Text AD upto 2500 Pakistan Business Mobiles Only Rs.5000/AD at 0333-2303103 or 0345-3034510. E-mail:removed\_email\_address@domain.invalid sms marketing mobile cell pakistan karachi islamabad lahore rawalpindi

---

## [Using ActiveResource to copy models with the same class?](https://www.ruby-forum.com/t/using-activeresource-to-copy-models-with-the-same-class/104810)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 1\
**Last updated:** [May 22, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/using-activeresource-to-copy-models-with-the-same-class/104810 "2007-05-22T22:15:29Z")

</div>

I’d like to be able to copy model objects from one site instance of my rails application to another and I’m wondering if I can use or adapt ActiveRecord for this purpose. The problem I have at the start is that the mo…

---

## [How Can I get radio button value](https://www.ruby-forum.com/t/how-can-i-get-radio-button-value/104818)

<div class="topic-metadata">

**Author:** [@alexey](https://www.ruby-forum.com/u/alexey)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/how-can-i-get-radio-button-value/104818 "2007-05-22T21:54:54Z")

</div>

Hi everyone I have such question: How Can I get radiobuttton value in controller, if I have such code for radio button in \_form.rhtml Duration \<%= radio\_button\_tag “duration”,“weekly”,true,:id =\> ‘weekly’ %\> Thank…

---

## [New Contest from Apple](https://www.ruby-forum.com/t/new-contest-from-apple/104807)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/new-contest-from-apple/104807 "2007-05-22T20:32:18Z")

</div>

http://www.apple.speedway-sweepstakes.com Win a 80GB Apple iPod ($349 USD). Valid until 6/30/07. Limit one entry per person. U.S. and Canada only. No purchase necessary.

---

## [Model: self is not child's parent](https://www.ruby-forum.com/t/model-self-is-not-childs-parent/104436)

<div class="topic-metadata">

**Author:** [@benhiller](https://www.ruby-forum.com/u/benhiller)\
**Replies:** 8\
**Last updated:** [May 22, 2007, 8:06pm UTC](https://www.ruby-forum.com/t/model-self-is-not-childs-parent/104436 "2007-05-22T20:06:13Z")

</div>

Assume a model Parent and another model Child. Child belongs\_to Parent and Parent has\_many Children. The following fails: @ p = Parent.find(:first) assert p.equal?(p.children\[0\].parent) @ It seems odd to me that …

---

## [Where put buissness logic?](https://www.ruby-forum.com/t/where-put-buissness-logic/103861)

<div class="topic-metadata">

**Author:** [@madiba](https://www.ruby-forum.com/u/madiba)\
**Replies:** 6\
**Last updated:** [May 22, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/where-put-buissness-logic/103861 "2007-05-22T18:59:03Z")

</div>

I’ve always think that it belongs to controller but I’ve read few articles that it should be done by model and controller should be thin glue betwean model and view. Where should I put it? Regards I’ve probably left …

---

## [Add/Remove OneToMany collection items w/o persisting?](https://www.ruby-forum.com/t/add-remove-onetomany-collection-items-w-o-persisting/104788)

<div class="topic-metadata">

**Author:** [@dennis](https://www.ruby-forum.com/u/dennis)\
**Replies:** 1\
**Last updated:** [May 22, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/add-remove-onetomany-collection-items-w-o-persisting/104788 "2007-05-22T17:58:49Z")

</div>

Ok. Case. I have one duck, which has many ducklings… Some of these ducklings ceases to exist (dies) or duck gives birth to new ducklings… However… A duckling is not an empty entity. There are some constraints in the d…

---

## [Custom Mime Types with Templates](https://www.ruby-forum.com/t/custom-mime-types-with-templates/104797)

<div class="topic-metadata">

**Author:** [@dmarkow](https://www.ruby-forum.com/u/dmarkow)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/custom-mime-types-with-templates/104797 "2007-05-22T17:49:44Z")

</div>

I have added a custom Mime Type for Excel files (xls). I’d like Rails to know to render these as XML in a “… .builder” view file. How can I tell Rails to treat the “XLS” extension just like an “XML” request?

---

## [Serving static subdirectories](https://www.ruby-forum.com/t/serving-static-subdirectories/104718)

<div class="topic-metadata">

**Author:** [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Replies:** 1\
**Last updated:** [May 22, 2007, 5:46pm UTC](https://www.ruby-forum.com/t/serving-static-subdirectories/104718 "2007-05-22T17:46:48Z")

</div>

A client of mine wants to put a friends site up at blah.com/blah/ How should I go about setting that up when I blah.com is a rails app managed by Capistrano and served via mongrel/apache? Just add the blah folder in t…

---

## [How to spend less time in views?](https://www.ruby-forum.com/t/how-to-spend-less-time-in-views/104794)

<div class="topic-metadata">

**Author:** [@Karl\_Larsson](https://www.ruby-forum.com/u/Karl_Larsson)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/how-to-spend-less-time-in-views/104794 "2007-05-22T17:12:30Z")

</div>

Hello all: For the last 6 months I been involved in 6 rails project and it seems to me that I am spending considerable amount of time in views (I am no CSS expert and making everything work on most browsers is “no f…

---

## [Instance variable attributes() method in tests fixtures](https://www.ruby-forum.com/t/instance-variable-attributes-method-in-tests-fixtures/104793)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [May 22, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/instance-variable-attributes-method-in-tests-fixtures/104793 "2007-05-22T17:11:15Z")

</div>

as stated in Rails Book example , I have a fixtures file orders.yml valid\_order\_for\_fred: id: 1 name: Fred email\_address: fred@flinstone;com in my controller test file, I tried : fixtures :orders def test\_save\_v…

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

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