# Rails

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

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

---

## [Custom serialization problem (marshal\_dump, marshal\_load)](https://www.ruby-forum.com/t/custom-serialization-problem-marshal-dump-marshal-load/138296)

<div class="topic-metadata">

**Author:** [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/custom-serialization-problem-marshal-dump-marshal-load/138296 "2008-05-21T22:18:13Z")

</div>

Hi, I have a problem with the marshal\_dump and marshal\_load… I built two classes XXX, YYY and implemented both methods like this: class YYY @data = “string” @version = 1 def marshal\_dump() return \[@version,@data\] …

---

## [Authentication System Help Needed](https://www.ruby-forum.com/t/authentication-system-help-needed/137917)

<div class="topic-metadata">

**Author:** [@Bobnation](https://www.ruby-forum.com/u/Bobnation)\
**Replies:** 9\
**Last updated:** [May 21, 2008, 9:49pm UTC](https://www.ruby-forum.com/t/authentication-system-help-needed/137917 "2008-05-21T21:49:24Z")

</div>

This is my first question posted here, I hope this goes well. I’m trying to work out a simple authentication system for my first Rails site using authenticate\_or\_request\_with\_http\_basic. Here is the code I am using ri…

---

## [Form question](https://www.ruby-forum.com/t/form-question/138290)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 9:20pm UTC](https://www.ruby-forum.com/t/form-question/138290 "2008-05-21T21:20:34Z")

</div>

I am guessing this is an easy question, I just can’t seem to find out how to do it. I have created an online assessment for kids. There are apprx. 20 different sections each having several questions. I have all the …

---

## [Mod\_passenger and mod\_php in same virtual host](https://www.ruby-forum.com/t/mod-passenger-and-mod-php-in-same-virtual-host/137890)

<div class="topic-metadata">

**Author:** [@benni](https://www.ruby-forum.com/u/benni)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/mod-passenger-and-mod-php-in-same-virtual-host/137890 "2008-05-21T20:56:49Z")

</div>

hey I would like to use an self-made rails app with a media-wiki in the SAME virtual host. the routing should work like following: domain.net/ → rails app domain.net/wiki/ → mediawiki My vhost configuration looks li…

---

## [\[JOB\] San Francisco, financial application](https://www.ruby-forum.com/t/job-san-francisco-financial-application/138301)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 8:51pm UTC](https://www.ruby-forum.com/t/job-san-francisco-financial-application/138301 "2008-05-21T20:51:30Z")

</div>

We’re a small startup looking for a contractor to help us build a part of our application. Location: The Presidio, San Francisco, California. No remote developers because you’ll work closely with customer staff on sit…

---

## [Mime sorting bug](https://www.ruby-forum.com/t/mime-sorting-bug/138298)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/mime-sorting-bug/138298 "2008-05-21T20:27:51Z")

</div>

Question: should rails’ mime handling prefer to render ‘longer’ named mime-types? It seems from the specs http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html that the preferred mime-type is whichever is highest q …

---

## [Form \_for usage](https://www.ruby-forum.com/t/form-for-usage/138195)

<div class="topic-metadata">

**Author:** [@frew](https://www.ruby-forum.com/u/frew)\
**Replies:** 8\
**Last updated:** [May 21, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/form-for-usage/138195 "2008-05-21T18:31:00Z")

</div>

Hi all, I am sure that this is documented somewhere, but I can’t find it. I have a class A that has references class B. Like, a.b.name. I was wondering how to represent that with form\_for? \<% form\_for(@a) do |f| %\>…

---

## [Before\_filter with multiple roles](https://www.ruby-forum.com/t/before-filter-with-multiple-roles/138265)

<div class="topic-metadata">

**Author:** [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Replies:** 8\
**Last updated:** [May 21, 2008, 6:21pm UTC](https://www.ruby-forum.com/t/before-filter-with-multiple-roles/138265 "2008-05-21T18:21:33Z")

</div>

I have multiple roles in my application. Now I want to block a method for all users except the administrator and a manager. When I do this: before\_filter (:check\_administrator\_role), :only =\> \[:administration\] befor…

---

## [Plugin Globalite --localization\_missing--](https://www.ruby-forum.com/t/plugin-globalite-localization-missing/138284)

<div class="topic-metadata">

**Author:** [@san1981](https://www.ruby-forum.com/u/san1981)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/plugin-globalite-localization-missing/138284 "2008-05-21T17:20:53Z")

</div>

Hello, I decided to use the plugin Globalite to automatically translate the error messages in French and German. Iâ€™ve then downloaded the plugin (vendor/plugins/svnâ€¦) and Iâ€™ve created a file fr-FR.yml and de-DE…

---

## [How to access Rails::Configuration instance methods](https://www.ruby-forum.com/t/how-to-access-rails-configuration-instance-methods/138271)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 5:17pm UTC](https://www.ruby-forum.com/t/how-to-access-rails-configuration-instance-methods/138271 "2008-05-21T17:17:18Z")

</div>

There was a thread yesterday about ENV\["\_"\] which is not available to Windows, I got to playing around with how to find access to the initializer\_path or in this case the root\_path My question is more about why I don…

---

## [Displaying my friends' friends in self-referential habtm](https://www.ruby-forum.com/t/displaying-my-friends-friends-in-self-referential-habtm/138269)

<div class="topic-metadata">

**Author:** [@pepa007](https://www.ruby-forum.com/u/pepa007)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/displaying-my-friends-friends-in-self-referential-habtm/138269 "2008-05-21T17:15:07Z")

</div>

Hi guys, I have a self-referential model of friends (based on Josh S.'s tutorial), i.e. basically sthg like tables ‘people’ and ‘relationships’. What I want is to display my friends together with their friends (and p…

---

## [List animals with average capture\_percent (Josh Susser's example)](https://www.ruby-forum.com/t/list-animals-with-average-capture-percent-josh-sussers-example/138263)

<div class="topic-metadata">

**Author:** [@pepa007](https://www.ruby-forum.com/u/pepa007)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 5:09pm UTC](https://www.ruby-forum.com/t/list-animals-with-average-capture-percent-josh-sussers-example/138263 "2008-05-21T17:09:00Z")

</div>

Hi guys, I implemented self-referential system based on Josh S.'s guidance on http://blog.hasmanythrough.com/2007/10/ … ny-through now I’m unsuccesfully trying to list all animals together with average hunt.capture\_p…

---

## [Creating and Filling PDF Forms](https://www.ruby-forum.com/t/creating-and-filling-pdf-forms/138266)

<div class="topic-metadata">

**Author:** [@Mark\_ASRichman](https://www.ruby-forum.com/u/Mark_ASRichman)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/creating-and-filling-pdf-forms/138266 "2008-05-21T17:00:46Z")

</div>

I am looking for two solutions: open source cross-platform alternative to Adobe LiveCycle Designer to create PDF forms method to fill in these PDF form fields from Rails and serve up the resulting PDF file Thanks, …

---

## [Parsing html tags to ruby characters](https://www.ruby-forum.com/t/parsing-html-tags-to-ruby-characters/138095)

<div class="topic-metadata">

**Author:** [@karthikeyan](https://www.ruby-forum.com/u/karthikeyan)\
**Replies:** 10\
**Last updated:** [May 21, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/parsing-html-tags-to-ruby-characters/138095 "2008-05-21T16:57:14Z")

</div>

Hi, I have a string containing some ruby code and html tags in-between. For example, str = “require 'my\_class.rb’ require ‘your\_class.rb’ :key=\>‘hello’” I want these html tags(’ ’, ’ ', ‘\>’, ‘\<’, ‘ ’, ‘’ etc…) t…

---

## [Looking for quality ROR web host in china](https://www.ruby-forum.com/t/looking-for-quality-ror-web-host-in-china/138280)

<div class="topic-metadata">

**Author:** [@Mongdar](https://www.ruby-forum.com/u/Mongdar)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 4:50pm UTC](https://www.ruby-forum.com/t/looking-for-quality-ror-web-host-in-china/138280 "2008-05-21T16:50:10Z")

</div>

Ideally a VPS for ruby on rails. the only hosting company i have found is http://gvt.hk/?s=5 but it is located in Hong Kong.

---

## [Coder's Block](https://www.ruby-forum.com/t/coders-block/137801)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 15\
**Last updated:** [May 21, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/coders-block/137801 "2008-05-21T16:40:45Z")

</div>

What do you do to help combat coders block, or that momentary lack of creativity, when you have a good design in your head, but you just can’t get it down on paper, so to speak? Do you: -Write in run-on sentences? (l…

---

## [Test returned value by sql statement](https://www.ruby-forum.com/t/test-returned-value-by-sql-statement/138268)

<div class="topic-metadata">

**Author:** [@joel](https://www.ruby-forum.com/u/joel)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/test-returned-value-by-sql-statement/138268 "2008-05-21T16:30:07Z")

</div>

Hello people, just wanted to know how to actually test returned value from sql statement like : @alreadyused = Promotioncodes.find\_by\_sql \[ “select alreadyused from promotioncodes where id = ?”, @codeid \] I would li…

---

## [Difference in render and render :update](https://www.ruby-forum.com/t/difference-in-render-and-render-update/138274)

<div class="topic-metadata">

**Author:** [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 4:10pm UTC](https://www.ruby-forum.com/t/difference-in-render-and-render-update/138274 "2008-05-21T16:10:40Z")

</div>

I have a situation where i am using extjs for my tab layouts. When i am getting a tab to be loaded i am making a call to a method and from there i do if(some condition) render :partial=\>‘x’ else render :partial=\>‘y…

---

## [Problem with alias\_method in a plugin](https://www.ruby-forum.com/t/problem-with-alias-method-in-a-plugin/138264)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/problem-with-alias-method-in-a-plugin/138264 "2008-05-21T15:18:55Z")

</div>

Hi, I’m doing my first plugin, based on attachment\_fu structure. Here’s the code: Parked at Loopia. The problem is that the meta\_tag method doesn’t seem to be overwritten. I can call model\_instance.original\_meta\_tag…

---

## [Scaffolding and ActiveRecord in Rails 2](https://www.ruby-forum.com/t/scaffolding-and-activerecord-in-rails-2/138259)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 3:12pm UTC](https://www.ruby-forum.com/t/scaffolding-and-activerecord-in-rails-2/138259 "2008-05-21T15:12:12Z")

</div>

Hi, Is is possible to add this constraint: “null =\> false” and “limit =\> 45” like below: create\_table :movie do |t| t.string :name, :null =\> false, :limit =\> 45 end …just by using this kind of scaffold command (on …

---

## [Download csv](https://www.ruby-forum.com/t/download-csv/138107)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 4\
**Last updated:** [May 21, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/download-csv/138107 "2008-05-21T14:27:29Z")

</div>

Hi, in my application i want to develop a code where when i click on download link , csv file get downloaded to client side. so for this i put Download the group template (requires Excel).(download\_template.csv is …

---

## [Polymorphic association now needs many to many relationship](https://www.ruby-forum.com/t/polymorphic-association-now-needs-many-to-many-relationship/138074)

<div class="topic-metadata">

**Author:** [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Replies:** 8\
**Last updated:** [May 21, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/polymorphic-association-now-needs-many-to-many-relationship/138074 "2008-05-21T14:19:50Z")

</div>

I have a polymorphic relationship between reviews and books/articles. It is working well under the assumption that each review is only related to a single book or article. Now, I realize that reviews can be associate…

---

## [How to download csv file](https://www.ruby-forum.com/t/how-to-download-csv-file/196685)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/how-to-download-csv-file/196685 "2008-05-21T14:14:33Z")

</div>

Hi, i want a such code which helps me download a csv file to each client machine when he click on download link, for this i am tried lots thing but it working for IE, but not for mac, Mozilla, safari. i want a optimu…

---

## [Pagination problem](https://www.ruby-forum.com/t/pagination-problem/138258)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/pagination-problem/138258 "2008-05-21T13:34:41Z")

</div>

Hi I have a partial file \_view\_sd\_attachments.rhtml.In that a link\_to\_remote is there also pagination code is there \<%= link\_to\_remote “Attach a file”, {:update =\> “view\_sd\_attachment”, :url =\> {:controller =\> ‘serv…

---

## [Parameter passing](https://www.ruby-forum.com/t/parameter-passing/137980)

<div class="topic-metadata">

**Author:** [@prionko](https://www.ruby-forum.com/u/prionko)\
**Replies:** 6\
**Last updated:** [May 21, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/parameter-passing/137980 "2008-05-21T12:46:04Z")

</div>

I have this 2 models in the rails application. class Project has\_many :comments class Comments belongs\_to :Project i.e in the Comment table I have column name project\_id. The model is such that for each projects th…

---

## [How get instance of form\_for object from @object\_name?](https://www.ruby-forum.com/t/how-get-instance-of-form-for-object-from-object-name/138210)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 14\
**Last updated:** [May 21, 2008, 12:37pm UTC](https://www.ruby-forum.com/t/how-get-instance-of-form-for-object-from-object-name/138210 "2008-05-21T12:37:14Z")

</div>

I have a custom form builder. In it I have a method for retrieving validation error messages. Currently it gets used like this: \<% form\_for :my\_obj… \<%= form.draw\_invalid\_msg(my\_obj.errors\[:userHosts\]) %\> I would li…

---

## [Text\_field\_with\_auto\_complete in a component?](https://www.ruby-forum.com/t/text-field-with-auto-complete-in-a-component/138215)

<div class="topic-metadata">

**Author:** [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 12:14pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-in-a-component/138215 "2008-05-21T12:14:54Z")

</div>

Maybe this one is just way too esoteric to matter all that much, but it’s bugging me. I’m doing a prototype for demonstration on Thursday, and making heavy use of components (scalability/performance not a concern, bu…

---

## [How to run script/server in a thread?](https://www.ruby-forum.com/t/how-to-run-script-server-in-a-thread/138253)

<div class="topic-metadata">

**Author:** [@arunmehta](https://www.ruby-forum.com/u/arunmehta)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 12:13pm UTC](https://www.ruby-forum.com/t/how-to-run-script-server-in-a-thread/138253 "2008-05-21T12:13:08Z")

</div>

I have an application in which a server part has been written using rails, and the client part using firewatir. I would like to fire both up with a single command. What mistake am I making below? I am running this fr…

---

## [How to check the existence of div?](https://www.ruby-forum.com/t/how-to-check-the-existence-of-div/138105)

<div class="topic-metadata">

**Author:** [@suneeta](https://www.ruby-forum.com/u/suneeta)\
**Replies:** 16\
**Last updated:** [May 21, 2008, 10:51am UTC](https://www.ruby-forum.com/t/how-to-check-the-existence-of-div/138105 "2008-05-21T10:51:52Z")

</div>

Hi… I have an rjs file to replace a div using ajax call. page\["#{params\[:id\]}parents"\].replace :partial =\> ‘cipart/expanded\_item’, :locals =\> { :expand\_items =\> CiRelation.find\_all\_by\_ci\_id(params\[:id\])} “#{param…

---

## [Calling a javascript function from rjs?](https://www.ruby-forum.com/t/calling-a-javascript-function-from-rjs/138240)

<div class="topic-metadata">

**Author:** [@suneeta](https://www.ruby-forum.com/u/suneeta)\
**Replies:** 4\
**Last updated:** [May 21, 2008, 10:50am UTC](https://www.ruby-forum.com/t/calling-a-javascript-function-from-rjs/138240 "2008-05-21T10:50:29Z")

</div>

Hi From an rjs file, I called a javascript function in ci.js as follows: page.call ‘test’,params\[:id\]+‘parents’ In ci.js I wrote the following: function test(div\_name) { alert(“testing…” +div\_name) if ($(div\_name)) …

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

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