# Rails

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

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

---

## [X\_send\_file download 1byte file instade of original size](https://www.ruby-forum.com/t/x-send-file-download-1byte-file-instade-of-original-size/158807)

<div class="topic-metadata">

**Author:** [@dharmdip](https://www.ruby-forum.com/u/dharmdip)\
**Replies:** 0\
**Last updated:** [January 28, 2009, 9:23am UTC](https://www.ruby-forum.com/t/x-send-file-download-1byte-file-instade-of-original-size/158807 "2009-01-28T09:23:11Z")

</div>

i m using x\_send\_file pluggins and download file then only 1byte file is downloaded. in Controller x\_send\_file("#{RAILS\_ROOT}/public#{params\[:file\]}") if you have idea for this problem so give me a solution

---

## [RubyOnRails with MS SQL - Connectivity Error](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454)

<div class="topic-metadata">

**Author:** [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Replies:** 7\
**Last updated:** [January 28, 2009, 9:18am UTC](https://www.ruby-forum.com/t/rubyonrails-with-ms-sql-connectivity-error/158454 "2009-01-28T09:18:44Z")

</div>

Hi all… Please help me solve the issue. While trying to create a connection with MS SQL database in RubyOnRails, I’m getting a â€˜Deprecated …â€™ error. (I referenced a doc posted in net for the same.) System detail…

---

## [Merging array with same key - HELP](https://www.ruby-forum.com/t/merging-array-with-same-key-help/158718)

<div class="topic-metadata">

**Author:** [@lookshankar](https://www.ruby-forum.com/u/lookshankar)\
**Replies:** 12\
**Last updated:** [January 28, 2009, 8:19am UTC](https://www.ruby-forum.com/t/merging-array-with-same-key-help/158718 "2009-01-28T08:19:21Z")

</div>

Hi , I need to merge an array in ruby on rails. array1 = \[‘01/01/2009’,‘01/01/2009’,‘10/01/2009’,‘01/01/2009’,‘10/01/2009’\] array2 = \[‘1stjan1’,‘1stjan2’,‘10thjan1’,‘1stjan3’,‘10thjan2’\] I need to have array like th…

---

## [Newbie question: types?](https://www.ruby-forum.com/t/newbie-question-types/158728)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [January 28, 2009, 6:51am UTC](https://www.ruby-forum.com/t/newbie-question-types/158728 "2009-01-28T06:51:11Z")

</div>

Hello RoR veterans. When looking at the following line in in the RoR getting started guide: script/generate scaffold Post name:string title:string content:text My first thought was “Nice!! So they demo string and tex…

---

## [ActiveRecord: Least surprise? Really?](https://www.ruby-forum.com/t/activerecord-least-surprise-really/158770)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [January 28, 2009, 6:49am UTC](https://www.ruby-forum.com/t/activerecord-least-surprise-really/158770 "2009-01-28T06:49:26Z")

</div>

OK I AM new to RoR, and I have more experience with Java and straight SQL. So maybe I’m just so used to thinking in a way that is anticipating more than “least” surprise. Anyway, here’s what surprised me: If I have…

---

## [Doing max of N tasks per given time](https://www.ruby-forum.com/t/doing-max-of-n-tasks-per-given-time/158725)

<div class="topic-metadata">

**Author:** [@ramontayag](https://www.ruby-forum.com/u/ramontayag)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 5:22am UTC](https://www.ruby-forum.com/t/doing-max-of-n-tasks-per-given-time/158725 "2009-01-28T05:22:19Z")

</div>

Hey everyone, PROBLEM I need some help. I have a Rails app on a VPS that connects to an external SMTP server that can only send up to 250 emails per hour. If I try to send the 251st email, it will just ignore it. S…

---

## [I have many Rails 3.0 questions here](https://www.ruby-forum.com/t/i-have-many-rails-3-0-questions-here/158521)

<div class="topic-metadata">

**Author:** [@webreservoir](https://www.ruby-forum.com/u/webreservoir)\
**Replies:** 9\
**Last updated:** [January 28, 2009, 5:08am UTC](https://www.ruby-forum.com/t/i-have-many-rails-3-0-questions-here/158521 "2009-01-28T05:08:45Z")

</div>

Hi, I am happy as well as confused with this Rails 3.0 == Merb 2.0 scenario. I understand within few months ( during RailsConf 2009, in May 2009 ) Rails 3.0 will be out to the public, and there would be no more confu…

---

## [Open\_uri failure on good uri](https://www.ruby-forum.com/t/open-uri-failure-on-good-uri/158799)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 5:05am UTC](https://www.ruby-forum.com/t/open-uri-failure-on-good-uri/158799 "2009-01-28T05:05:56Z")

</div>

I am trying to open a URI using doc = Nokogiri::HTML(open(url)). I get the following error: URI::InvalidURIError: bad URI(is not URI?): http://www.mauipropertytax.com/Datalets.asp?mnu=PSearch&submnu=Profile&pin=390350…

---

## [How to share tables between Ruby Apps](https://www.ruby-forum.com/t/how-to-share-tables-between-ruby-apps/158795)

<div class="topic-metadata">

**Author:** [@LaughingNinja](https://www.ruby-forum.com/u/LaughingNinja)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 4:50am UTC](https://www.ruby-forum.com/t/how-to-share-tables-between-ruby-apps/158795 "2009-01-28T04:50:44Z")

</div>

Hi, We are in the process of rewriting our intranet applications in Ruby. We have one complete that requires an email invite being sent. We want to write another app that simply looks for unsent emails and sends them…

---

## [Login form\_tag with select\_tag option](https://www.ruby-forum.com/t/login-form-tag-with-select-tag-option/158736)

<div class="topic-metadata">

**Author:** [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 4:49am UTC](https://www.ruby-forum.com/t/login-form-tag-with-select-tag-option/158736 "2009-01-28T04:49:35Z")

</div>

Hi all, In the application i develop, a sophisticated login system is required. Being a newbie in Ruby, i’m not comfortable with the select tag in the form tag. My requirement: 2 tables - User(LoginName, Password, R…

---

## [Request.env variables in an observer](https://www.ruby-forum.com/t/request-env-variables-in-an-observer/158771)

<div class="topic-metadata">

**Author:** [@Dowker](https://www.ruby-forum.com/u/Dowker)\
**Replies:** 1\
**Last updated:** [January 28, 2009, 4:09am UTC](https://www.ruby-forum.com/t/request-env-variables-in-an-observer/158771 "2009-01-28T04:09:49Z")

</div>

I have a scenario were I would like to inject the IP address and UserAgent into an email when a database record is saved. I was thinking of implementing this via an observer but I don’t know how to access the environm…

---

## [Changing model type](https://www.ruby-forum.com/t/changing-model-type/158793)

<div class="topic-metadata">

**Author:** [@jaredmoody](https://www.ruby-forum.com/u/jaredmoody)\
**Replies:** 1\
**Last updated:** [January 28, 2009, 3:22am UTC](https://www.ruby-forum.com/t/changing-model-type/158793 "2009-01-28T03:22:20Z")

</div>

I have a form that allows a User to add/edit the additional Users or LoginUsers to/on their account, but the wrong validations are run when updating a User to be a Login user or vice-versa. For more clarity (with only…

---

## [Creating records with file upload in migration](https://www.ruby-forum.com/t/creating-records-with-file-upload-in-migration/158769)

<div class="topic-metadata">

**Author:** [@drsharp](https://www.ruby-forum.com/u/drsharp)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 2:53am UTC](https://www.ruby-forum.com/t/creating-records-with-file-upload-in-migration/158769 "2009-01-28T02:53:02Z")

</div>

Hi, I have a migration which creates several records along with the table. eg Forum.create :title =\> “General Discussion”, :description =\> “General Chit-Chat” But I’d like to create a record which accepts an uploade…

---

## [Ruby regular expression issue matching](https://www.ruby-forum.com/t/ruby-regular-expression-issue-matching/158794)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 2:20am UTC](https://www.ruby-forum.com/t/ruby-regular-expression-issue-matching/158794 "2009-01-28T02:20:51Z")

</div>

I have something like this to match: //s-#{slot}/p-#{port}/sts-#{sts}/ The problem is the variable STS if it is a 1 matches on 1,10,11,12,13 and so on. How do I get it to match only the value and nothing sles?

---

## [Right way to do](https://www.ruby-forum.com/t/right-way-to-do/158760)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 1\
**Last updated:** [January 28, 2009, 2:02am UTC](https://www.ruby-forum.com/t/right-way-to-do/158760 "2009-01-28T02:02:42Z")

</div>

What is the right way to print localizations? \<%=t :User %\> OR \<%=t “User” %\> OR \<%=t (“User”) %\> \<%=t :User %\> works fine, but \<%=t :User.Username %\> doesn’t, but this works: \<%=t (“User.Username”) %\>

---

## [Extending AR to write audit columns](https://www.ruby-forum.com/t/extending-ar-to-write-audit-columns/158765)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 1:38am UTC](https://www.ruby-forum.com/t/extending-ar-to-write-audit-columns/158765 "2009-01-28T01:38:54Z")

</div>

Rails 2.2.2 Ruby 1.8.5 I am attempting to extend AR with a generalized audit attribute setter. I have written this code, which does not work for reasons unknown to me. Perhaps someone here can explain why it does not…

---

## [Acts as indexed suitable?](https://www.ruby-forum.com/t/acts-as-indexed-suitable/158792)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 0\
**Last updated:** [January 28, 2009, 1:19am UTC](https://www.ruby-forum.com/t/acts-as-indexed-suitable/158792 "2009-01-28T01:19:26Z")

</div>

I’m using the acts as indexed to sort of implement a full text search for titles of stories. This is working perfectly, but it seems it stores these indexes in files. This worries me since I fear there may be a lot of…

---

## [Absolute image URL?](https://www.ruby-forum.com/t/absolute-image-url/158773)

<div class="topic-metadata">

**Author:** [@sven](https://www.ruby-forum.com/u/sven)\
**Replies:** 3\
**Last updated:** [January 28, 2009, 12:47am UTC](https://www.ruby-forum.com/t/absolute-image-url/158773 "2009-01-28T00:47:14Z")

</div>

I’m generating an XML feed to be used from outside of a Rails application. The feed should include URLs for associated images. I’m using image\_path to generate the image URLs. This respects relative\_url\_root, but all …

---

## [Newbie testing: xml\_http\_request and route, route not recognised](https://www.ruby-forum.com/t/newbie-testing-xml-http-request-and-route-route-not-recognised/158791)

<div class="topic-metadata">

**Author:** [@itsastickup](https://www.ruby-forum.com/u/itsastickup)\
**Replies:** 0\
**Last updated:** [January 28, 2009, 12:44am UTC](https://www.ruby-forum.com/t/newbie-testing-xml-http-request-and-route-route-not-recognised/158791 "2009-01-28T00:44:53Z")

</div>

In my view the generated html has this, and it works just fine: \<a href=“/people/2/movies/19” method=“delete” onclick=“if (confirm (‘Delete “Highlander”. Are you sure?’)) { new Ajax.Request(‘/people/2/ movies/19’, {as…

---

## [Javascript and caching](https://www.ruby-forum.com/t/javascript-and-caching/158785)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [January 27, 2009, 11:33pm UTC](https://www.ruby-forum.com/t/javascript-and-caching/158785 "2009-01-27T23:33:28Z")

</div>

Hi guys, I’ll start to develop a new app that uses some heavy js librarys (prototype, scriptaculous, tinymce and so on). Someone told me to make all the app using ajax, so all the js files will be loaded only once. M…

---

## [Redirect\_to problem .. caching?](https://www.ruby-forum.com/t/redirect-to-problem-caching/81031)

<div class="topic-metadata">

**Author:** [@Michael\_Mandecki](https://www.ruby-forum.com/u/Michael_Mandecki)\
**Replies:** 9\
**Last updated:** [January 27, 2009, 10:50pm UTC](https://www.ruby-forum.com/t/redirect-to-problem-caching/81031 "2009-01-27T22:50:15Z")

</div>

I’m having problems with the code below. The @photo.save seems to work (an entry is made in the database), but ‘Success!’ doesn’t appear on the " tagging.rhtml" page unless I refresh the browser. It looks like some …

---

## [Saving ActiveRecord/Form data changes?](https://www.ruby-forum.com/t/saving-activerecord-form-data-changes/158783)

<div class="topic-metadata">

**Author:** [@bburcham](https://www.ruby-forum.com/u/bburcham)\
**Replies:** 0\
**Last updated:** [January 27, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/saving-activerecord-form-data-changes/158783 "2009-01-27T22:46:17Z")

</div>

Greetings everyone, This post has been moved (on suggestion) from the Ruby forum. I can’t pass updated/changed values from the form elements to the ActiveRecord. However something is going through because the table’s …

---

## [User Permalink in Rails?](https://www.ruby-forum.com/t/user-permalink-in-rails/158614)

<div class="topic-metadata">

**Author:** [@lpdahito](https://www.ruby-forum.com/u/lpdahito)\
**Replies:** 10\
**Last updated:** [January 27, 2009, 9:10pm UTC](https://www.ruby-forum.com/t/user-permalink-in-rails/158614 "2009-01-27T21:10:31Z")

</div>

Hey guys, How do we create Permalinks for users in a Rails application ??? By Permalink a mean the name of the user in the URL like so: example.com/username… Or like twitter and everyone does it ex: twitter.com/usern…

---

## [\[ActiveRecord\] How to automatically bind, for example, :rows with Row or :user\_id with User?](https://www.ruby-forum.com/t/activerecord-how-to-automatically-bind-for-example-rows-with-row-or-user-id-with-user/158651)

<div class="topic-metadata">

**Author:** [@Pierre\_L](https://www.ruby-forum.com/u/Pierre_L)\
**Replies:** 2\
**Last updated:** [January 27, 2009, 8:33pm UTC](https://www.ruby-forum.com/t/activerecord-how-to-automatically-bind-for-example-rows-with-row-or-user-id-with-user/158651 "2009-01-27T20:33:16Z")

</div>

Hello, Imagine that I have the two following models : class A \< ActiveRecord::Base belongs\_to :b, :foreign =\> :fkey end class B \< ActiveRecord::Base end Is it possible to retrieve both classes A and B and that col…

---

## [Keeping separate lists of parent objects](https://www.ruby-forum.com/t/keeping-separate-lists-of-parent-objects/158730)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [January 27, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/keeping-separate-lists-of-parent-objects/158730 "2009-01-27T20:08:37Z")

</div>

OK here’s the deal. I have a Verification object that I want to use to allow users to verify data (Posts, Pics, Addresses, etc). Each Post, Address, etc object will be related 1:1 to a Verification object. But I wa…

---

## [Is there a "touch" method for associated records?](https://www.ruby-forum.com/t/is-there-a-touch-method-for-associated-records/158751)

<div class="topic-metadata">

**Author:** [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Replies:** 2\
**Last updated:** [January 27, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/is-there-a-touch-method-for-associated-records/158751 "2009-01-27T19:40:53Z")

</div>

I’m sure I can whip something up to do this, but I’m wondering an elegant solution already exists. I will have any number of Registration objects coming in through web form, but I wish there to be only one User objec…

---

## [Migration Broken?](https://www.ruby-forum.com/t/migration-broken/158749)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 3\
**Last updated:** [January 27, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/migration-broken/158749 "2009-01-27T18:20:48Z")

</div>

I’ve created a migration to create a new table. I’m noting that the format of the migration name created by the generator has changed. Up until now, the migration names were of the form “00n\_” … now the form is \_. Th…

---

## [Manipulating "params\[:some\]" with ActiveRecod::Find on ":select" method](https://www.ruby-forum.com/t/manipulating-params-some-with-activerecod-find-on-select-method/158748)

<div class="topic-metadata">

**Author:** [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Replies:** 1\
**Last updated:** [January 27, 2009, 5:38pm UTC](https://www.ruby-forum.com/t/manipulating-params-some-with-activerecod-find-on-select-method/158748 "2009-01-27T17:38:22Z")

</div>

Hello all, I trying to pass the params from a form to the :select (field list) in my controller like this =\> Processo.find :all,:conditions =\> { :tipo\_acao\_id =\> params\[:tipo\_acao\_id\], :fase\_id =\> (params\[:fase\_i…

---

## [Format.atom w Rails 2.2](https://www.ruby-forum.com/t/format-atom-w-rails-2-2/158744)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 1\
**Last updated:** [January 27, 2009, 4:29pm UTC](https://www.ruby-forum.com/t/format-atom-w-rails-2-2/158744 "2009-01-27T16:29:25Z")

</div>

in Rails 2.1, this works… but I am stuck w Rails 2.2 class PostsController \< ApplicationController def show … respond\_to do |format| format.html format.atom { render :action =\> ‘changes’, :layout =\> false, :conten…

---

## [Ruby script/server ERROR](https://www.ruby-forum.com/t/ruby-script-server-error/158737)

<div class="topic-metadata">

**Author:** [@basma](https://www.ruby-forum.com/u/basma)\
**Replies:** 6\
**Last updated:** [January 27, 2009, 4:17pm UTC](https://www.ruby-forum.com/t/ruby-script-server-error/158737 "2009-01-27T16:17:35Z")

</div>

Hi I have a problem when I use the command ruby script/server in some of applications , the server dose not working end exiting before I close it! to know what I mean please see the attachment! How I deal with a s…

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

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