# Rails

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

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

---

## [Passenger 2.2.2 error](https://www.ruby-forum.com/t/passenger-2-2-2-error/170800)

<div class="topic-metadata">

**Author:** [@ssk](https://www.ruby-forum.com/u/ssk)\
**Replies:** 0\
**Last updated:** [June 23, 2009, 12:22am UTC](https://www.ruby-forum.com/t/passenger-2-2-2-error/170800 "2009-06-23T00:22:29Z")

</div>

Hi, I deployed an rails 2.3.2 app on passenger 2.2.2. I get the following error sometimes. Is it something I can fix in my app or not? Passenger encountered the following error: The application spawner server exited…

---

## [Trying to redirect to an external website](https://www.ruby-forum.com/t/trying-to-redirect-to-an-external-website/170792)

<div class="topic-metadata">

**Author:** [@adsouzp](https://www.ruby-forum.com/u/adsouzp)\
**Replies:** 7\
**Last updated:** [June 22, 2009, 11:26pm UTC](https://www.ruby-forum.com/t/trying-to-redirect-to-an-external-website/170792 "2009-06-22T23:26:56Z")

</div>

I’m looking for this to work \<%= redirect\_to(post.link\_url) %\> I tried this a few different ways. All I get is " undefined method \`redirect\_to’ " when I try that. How do you go about doing this?

---

## [Updating a Text box](https://www.ruby-forum.com/t/updating-a-text-box/170787)

<div class="topic-metadata">

**Author:** [@fireknite](https://www.ruby-forum.com/u/fireknite)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 10:24pm UTC](https://www.ruby-forum.com/t/updating-a-text-box/170787 "2009-06-22T22:24:28Z")

</div>

I have a page with a collection\_select, populated by an array of info pulled form a MySQL table. Trying to get some text\_fields to update with information from this array depending on which item was selected from the…

---

## [Rails with composite primary keys and string keys](https://www.ruby-forum.com/t/rails-with-composite-primary-keys-and-string-keys/170770)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 3\
**Last updated:** [June 22, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/rails-with-composite-primary-keys-and-string-keys/170770 "2009-06-22T21:55:31Z")

</div>

The guy who is designing our database seems to have specified some keys that are strings as well as some composite keys which are part integer and part string. I guess I could support that in rails by using find\_by\_sq…

---

## [ActionMailer plain text problem and UPPERCASE chars](https://www.ruby-forum.com/t/actionmailer-plain-text-problem-and-uppercase-chars/170781)

<div class="topic-metadata">

**Author:** [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Replies:** 5\
**Last updated:** [June 22, 2009, 8:37pm UTC](https://www.ruby-forum.com/t/actionmailer-plain-text-problem-and-uppercase-chars/170781 "2009-06-22T20:37:31Z")

</div>

Hello, I am using ActionMailer 2.3.3 to send out a very simple plain text email. I am having a very strange issue where the email will not be sent out if some of the the lines in the view are set to all caps. I can’t…

---

## [How to restart an app under Passenger](https://www.ruby-forum.com/t/how-to-restart-an-app-under-passenger/163569)

<div class="topic-metadata">

**Author:** [@avramd](https://www.ruby-forum.com/u/avramd)\
**Replies:** 7\
**Last updated:** [June 22, 2009, 8:17pm UTC](https://www.ruby-forum.com/t/how-to-restart-an-app-under-passenger/163569 "2009-06-22T20:17:43Z")

</div>

Hello, I’m running a rails app on Dreamhost, which uses Passenger. Sometimes I have a very tiny change to make in my code, and have it take effect immediately. However I can’t figure out how to trigger Passenger to r…

---

## [Plugins still exist even though they're deleted?](https://www.ruby-forum.com/t/plugins-still-exist-even-though-theyre-deleted/170685)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 6\
**Last updated:** [June 22, 2009, 6:54pm UTC](https://www.ruby-forum.com/t/plugins-still-exist-even-though-theyre-deleted/170685 "2009-06-22T18:54:12Z")

</div>

So I deleted some plugins from my app on my local machine and pushed the changes to my git repository. Using capistrano to update the code, I found that the plugins still exist in the current directory! Does anyone ha…

---

## [How to get files in s3 directory?](https://www.ruby-forum.com/t/how-to-get-files-in-s3-directory/170750)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 3\
**Last updated:** [June 22, 2009, 6:43pm UTC](https://www.ruby-forum.com/t/how-to-get-files-in-s3-directory/170750 "2009-06-22T18:43:34Z")

</div>

how to get files in s3 directory like following? s3://1eM20RW1CJAFGTH5YHs2:ahEbquj3/ W8ZuYE1ZfGK9KblxdZ7ATsHX3Jb59Uk@daociyiyou

---

## [Initializers and automatically running code](https://www.ruby-forum.com/t/initializers-and-automatically-running-code/170772)

<div class="topic-metadata">

**Author:** [@talex83](https://www.ruby-forum.com/u/talex83)\
**Replies:** 2\
**Last updated:** [June 22, 2009, 6:28pm UTC](https://www.ruby-forum.com/t/initializers-and-automatically-running-code/170772 "2009-06-22T18:28:45Z")

</div>

I want to decorate ActiveRecord with a new method so that any classes that inherit from it also have the method. I’ve been told that initializers are the way to go, yet when I put a file in initializers containing: c…

---

## [Pdf generation](https://www.ruby-forum.com/t/pdf-generation/128258)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 15\
**Last updated:** [June 22, 2009, 5:38pm UTC](https://www.ruby-forum.com/t/pdf-generation/128258 "2009-06-22T17:38:30Z")

</div>

Hi Can anybody which is the best pdf generator in rails.There are many like \* HTMLDOC \* PdfWriter \* PDF::Writer (Austin Z.) \* Ruby FPDF \* JasperReports \* PDF Form Fill \* PDFlib and PDFlib-Lite \* Rfpdf Can anybody …

---

## [Protect\_from\_forgery with db-session (Rails 2.3.2)](https://www.ruby-forum.com/t/protect-from-forgery-with-db-session-rails-2-3-2/170764)

<div class="topic-metadata">

**Author:** [@robintw](https://www.ruby-forum.com/u/robintw)\
**Replies:** 2\
**Last updated:** [June 22, 2009, 5:18pm UTC](https://www.ruby-forum.com/t/protect-from-forgery-with-db-session-rails-2-3-2/170764 "2009-06-22T17:18:17Z")

</div>

I try to use db-session with protect\_from\_forgery. But I always get a error msg: ActionController::InvalidAuthenticityToken. application\_controller.rb protect\_from\_forgery #:secret =\> ‘top\_secret’ session\_store.rb …

---

## [Cannot do mass\_assignment when inherited class?](https://www.ruby-forum.com/t/cannot-do-mass-assignment-when-inherited-class/170708)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 4:15pm UTC](https://www.ruby-forum.com/t/cannot-do-mass-assignment-when-inherited-class/170708 "2009-06-22T16:15:49Z")

</div>

I got the following error when trying to create the elibrary instance (rdb:21) @elibrary = Elibrary.new(params\[:elibrary\]) RuntimeError Exception: Declare either attr\_protected or attr\_accessible for Elibrary, but not…

---

## [How to get form element id's?](https://www.ruby-forum.com/t/how-to-get-form-element-ids/170760)

<div class="topic-metadata">

**Author:** [@jdunneuk](https://www.ruby-forum.com/u/jdunneuk)\
**Replies:** 2\
**Last updated:** [June 22, 2009, 3:41pm UTC](https://www.ruby-forum.com/t/how-to-get-form-element-ids/170760 "2009-06-22T15:41:46Z")

</div>

Hi there, I’m going to start with an example: \<% form\_for(@post) do |f| %\> \<%= f.label :title %\> \<%= f.text\_field :title %\> \<% end %\> Generates: Title Is there any way to get the in…

---

## [Running Flash files (swf / flv) under rails](https://www.ruby-forum.com/t/running-flash-files-swf-flv-under-rails/170763)

<div class="topic-metadata">

**Author:** [@norricorp](https://www.ruby-forum.com/u/norricorp)\
**Replies:** 0\
**Last updated:** [June 22, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/running-flash-files-swf-flv-under-rails/170763 "2009-06-22T15:38:40Z")

</div>

I have been trying to run a swf file within a rails webpage. I have a swf file that uses a videodisplay and two buttons (play and pause) and references flv video. This code works using AIR (as a windowedapplication) b…

---

## [Error with Message.find()](https://www.ruby-forum.com/t/error-with-message-find/170756)

<div class="topic-metadata">

**Author:** [@Nash](https://www.ruby-forum.com/u/Nash)\
**Replies:** 3\
**Last updated:** [June 22, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/error-with-message-find/170756 "2009-06-22T15:17:39Z")

</div>

I’ve code http://pastebin.com/m474f7e1d I get error: uninitialized constant ChatController::Message it’s from http://ruby.inuse.ru/article/ror-razrabotka-chata Help plz.

---

## [Create or update\_attribute method](https://www.ruby-forum.com/t/create-or-update-attribute-method/170748)

<div class="topic-metadata">

**Author:** [@on9west](https://www.ruby-forum.com/u/on9west)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 2:10pm UTC](https://www.ruby-forum.com/t/create-or-update-attribute-method/170748 "2009-06-22T14:10:36Z")

</div>

Dear all Are there any method to create or update something? (if something exist, then update, else create…where something is the primary key) Something like… if Klass.find\_by\_something( xxx ) Klass.update\_attribute…

---

## [Modal validation not works](https://www.ruby-forum.com/t/modal-validation-not-works/170737)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 4\
**Last updated:** [June 22, 2009, 11:36am UTC](https://www.ruby-forum.com/t/modal-validation-not-works/170737 "2009-06-22T11:36:42Z")

</div>

Hi everyone, i have 20 fields in users table. in my admin profile module the admin can modify his infomation. but only 12 fields he can able to modify. so in my controller if params\[ :profileinfo \]\[:first\_name\] @pr…

---

## [\[Plugin dev.\] Hook into ActionController::Base properly](https://www.ruby-forum.com/t/plugin-dev-hook-into-actioncontroller-base-properly/170670)

<div class="topic-metadata">

**Author:** [@metafoo](https://www.ruby-forum.com/u/metafoo)\
**Replies:** 4\
**Last updated:** [June 22, 2009, 11:26am UTC](https://www.ruby-forum.com/t/plugin-dev-hook-into-actioncontroller-base-properly/170670 "2009-06-22T11:26:44Z")

</div>

Hi all, currently I’m developing a plugin wich shoud hook into ActionController. To do that, I’m using ActionController::Base.send(:include, …) but when I want to call the according methods from within a controller, I …

---

## [Send\_file](https://www.ruby-forum.com/t/send-file/170739)

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 11:06am UTC](https://www.ruby-forum.com/t/send-file/170739 "2009-06-22T11:06:08Z")

</div>

send\_file method is not working in rails . Here i have mentioned my program . The program is filename = File.join(RAILS\_ROOT, ‘public’, ‘4000.xls’) send\_file\_options = { :length =\> File.size( filename ), …

---

## [MySql as database in Leopard --- Will not rake](https://www.ruby-forum.com/t/mysql-as-database-in-leopard-will-not-rake/170694)

<div class="topic-metadata">

**Author:** [@evandrake](https://www.ruby-forum.com/u/evandrake)\
**Replies:** 3\
**Last updated:** [June 22, 2009, 10:44am UTC](https://www.ruby-forum.com/t/mysql-as-database-in-leopard-will-not-rake/170694 "2009-06-22T10:44:22Z")

</div>

I am trying to create a new application on Mac OSX Leopard with MySql instead of Sqlite3, and I am having loads of trouble. I have installed mysql and I can connect properly through mysql -u root -p. I have also inst…

---

## [Array unshift and save to database](https://www.ruby-forum.com/t/array-unshift-and-save-to-database/170738)

<div class="topic-metadata">

**Author:** [@gpierce](https://www.ruby-forum.com/u/gpierce)\
**Replies:** 0\
**Last updated:** [June 22, 2009, 10:26am UTC](https://www.ruby-forum.com/t/array-unshift-and-save-to-database/170738 "2009-06-22T10:26:16Z")

</div>

Hello, I’ve noticed that I can’t save my object to the DB after using ‘unshift’ on one of Array fileds. Ex: (below ‘tags’ is a collection in object ‘transaction’) transaction.tags.unshift(Tag.find\_or\_create\_by\_name(n…

---

## [Getting error can't modify frozen hash](https://www.ruby-forum.com/t/getting-error-cant-modify-frozen-hash/197091)

<div class="topic-metadata">

**Author:** [@skumar](https://www.ruby-forum.com/u/skumar)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 8:55am UTC](https://www.ruby-forum.com/t/getting-error-cant-modify-frozen-hash/197091 "2009-06-22T08:55:26Z")

</div>

Hi, When I upgraded my rails application to rails 2.3.2 I am getting error ‘can’t modify frozen hash’ on using @something.update\_attribute(params\[:something\]). Can anyone help me who is familiarize with this bug? Th…

---

## [Respond\_to issue in IE7](https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604)

<div class="topic-metadata">

**Author:** [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Replies:** 2\
**Last updated:** [June 22, 2009, 6:33am UTC](https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604 "2009-06-22T06:33:30Z")

</div>

Hi all, can somebody help me with this issue in respond\_to? def new respond\_to do |format| format.xml { puts ‘xml’} format.html { puts ‘html’} format.pdf { puts ‘pdf’} format.js { puts ‘js’} end end When i r…

---

## [How params (without @) works?](https://www.ruby-forum.com/t/how-params-without-works/170725)

<div class="topic-metadata">

**Author:** [@Xiahong\_G](https://www.ruby-forum.com/u/Xiahong_G)\
**Replies:** 2\
**Last updated:** [June 22, 2009, 5:20am UTC](https://www.ruby-forum.com/t/how-params-without-works/170725 "2009-06-22T05:20:18Z")

</div>

I am newb. I feel confused about how params works. I understand @params is an attribute of CLASS, but what is params? A named parameter? Because I thought instance attributes always begin with "@”, so params/request/f…

---

## [Problems with has\_many :through and habtm](https://www.ruby-forum.com/t/problems-with-has-many-through-and-habtm/170686)

<div class="topic-metadata">

**Author:** [@erik](https://www.ruby-forum.com/u/erik)\
**Replies:** 5\
**Last updated:** [June 21, 2009, 11:03pm UTC](https://www.ruby-forum.com/t/problems-with-has-many-through-and-habtm/170686 "2009-06-21T23:03:03Z")

</div>

I have tried this both ways and each time same results, duplicate entries. Here is the simple test: t = Trim.find(:first, :conditions =\> \[‘id \> 65000000’\]) options = Option.find\_all\_by\_trim\_id(t.id) puts options.siz…

---

## [Trying to create a contact form](https://www.ruby-forum.com/t/trying-to-create-a-contact-form/170714)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 9\
**Last updated:** [June 21, 2009, 10:54pm UTC](https://www.ruby-forum.com/t/trying-to-create-a-contact-form/170714 "2009-06-21T22:54:56Z")

</div>

I’ve been working on a contact form, however, most of the examples I see posted are outdated and I’m just having some trouble getting this to work. Here’s what I’ve done so far: At the bottom of my environment.rb fil…

---

## [Capistrano and "the task \`cleanup' does not exist"](https://www.ruby-forum.com/t/capistrano-and-the-task-cleanup-does-not-exist/170716)

<div class="topic-metadata">

**Author:** [@nickflux](https://www.ruby-forum.com/u/nickflux)\
**Replies:** 2\
**Last updated:** [June 21, 2009, 9:58pm UTC](https://www.ruby-forum.com/t/capistrano-and-the-task-cleanup-does-not-exist/170716 "2009-06-21T21:58:53Z")

</div>

I use Capistrano for deploying my apps, and have been doing so for a while. I keep seeing references to the ‘cleanup’ task, as in: desc “Cleanup after every deployment” task :after\_deploy do cleanup end But I don’…

---

## [Redirect\_back\_or\_default not work properly](https://www.ruby-forum.com/t/redirect-back-or-default-not-work-properly/170495)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 3\
**Last updated:** [June 21, 2009, 9:25pm UTC](https://www.ruby-forum.com/t/redirect-back-or-default-not-work-properly/170495 "2009-06-21T21:25:42Z")

</div>

I use rails2.3 and restful\_authentication-plugin.I use the redirect\_back\_or\_default action like this redirect\_back\_or\_default (’/’) ,that is-it assumes not login now,if login directly,redirect to homepage,if not,redir…

---

## [Parsing XML POST params](https://www.ruby-forum.com/t/parsing-xml-post-params/170710)

<div class="topic-metadata">

**Author:** [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Replies:** 6\
**Last updated:** [June 21, 2009, 8:07pm UTC](https://www.ruby-forum.com/t/parsing-xml-post-params/170710 "2009-06-21T20:07:54Z")

</div>

We’ve just upgraded our Rails 2.0.2 app to 2.3 and the webservices create APIs are failing. Instead of receiving parsed XML, the controller’s create method gets the whole xml as a hash key with the value nil. To iso…

---

## [Respond\_to and ActionController::InvalidAuthenticityToken](https://www.ruby-forum.com/t/respond-to-and-actioncontroller-invalidauthenticitytoken/125145)

<div class="topic-metadata">

**Author:** [@dewie](https://www.ruby-forum.com/u/dewie)\
**Replies:** 8\
**Last updated:** [June 21, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/respond-to-and-actioncontroller-invalidauthenticitytoken/125145 "2009-06-21T19:24:32Z")

</div>

I have a create action that accepts both standard form POSTs and Ajax-powered posts. Traditionally I’ve forked the response to these requests by saying: if request.xhr? Do the new thing else Do the old thing end To…

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

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