# Rails

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

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

---

## [Can't get an Array function to be visible inside ApplicationHelper](https://www.ruby-forum.com/t/cant-get-an-array-function-to-be-visible-inside-applicationhelper/165317)

<div class="topic-metadata">

**Author:** [@skt](https://www.ruby-forum.com/u/skt)\
**Replies:** 4\
**Last updated:** [April 12, 2009, 9:25pm UTC](https://www.ruby-forum.com/t/cant-get-an-array-function-to-be-visible-inside-applicationhelper/165317 "2009-04-12T21:25:52Z")

</div>

Folks, I seem to be missing something basic here. I am trying to call a function from my application layout that will return me a hash of the roles for the user currently signed in. Here is the simplified code I have…

---

## [Unit test problem with time update](https://www.ruby-forum.com/t/unit-test-problem-with-time-update/165309)

<div class="topic-metadata">

**Author:** [@ps\_gem](https://www.ruby-forum.com/u/ps_gem)\
**Replies:** 3\
**Last updated:** [April 12, 2009, 8:43pm UTC](https://www.ruby-forum.com/t/unit-test-problem-with-time-update/165309 "2009-04-12T20:43:10Z")

</div>

Hi all, I am new to Ruby on Rails and struggling to finish my class project. I have problem with unit testing, if any body could help. I have a function that updates ‘feeds’ table. It has a columns: id, feeddata, la…

---

## [Undefined method \`cache\_template\_extension' - Not finding how to fix that](https://www.ruby-forum.com/t/undefined-method-cache-template-extension-not-finding-how-to-fix-that/165343)

<div class="topic-metadata">

**Author:** [@felipecsl](https://www.ruby-forum.com/u/felipecsl)\
**Replies:** 0\
**Last updated:** [April 12, 2009, 8:36pm UTC](https://www.ruby-forum.com/t/undefined-method-cache-template-extension-not-finding-how-to-fix-that/165343 "2009-04-12T20:36:40Z")

</div>

Hello I upgraded my rails to the version 2.3.2, but after restarting my server, this error happened, I researched in some threads and discovered that cache\_template\_extensions is deprecated, but i couldn’t find it in …

---

## [Handling ActiveRecord::RecordNotFound](https://www.ruby-forum.com/t/handling-activerecord-recordnotfound/165338)

<div class="topic-metadata">

**Author:** [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Replies:** 1\
**Last updated:** [April 12, 2009, 6:54pm UTC](https://www.ruby-forum.com/t/handling-activerecord-recordnotfound/165338 "2009-04-12T18:54:53Z")

</div>

How should we handle requests for invalid objects which do not exist in database, ActiveRecord::RecordNotFound error ? I am writing begin-rescue as follows: def show begin @phone = Phone.find(params\[:id\]) rescue Ac…

---

## [Params\[:commit\] doesn't work](https://www.ruby-forum.com/t/params-commit-doesnt-work/165337)

<div class="topic-metadata">

**Author:** [@jackyang](https://www.ruby-forum.com/u/jackyang)\
**Replies:** 4\
**Last updated:** [April 12, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/params-commit-doesnt-work/165337 "2009-04-12T17:12:23Z")

</div>

I have a form with two submit buttons: “Save” and “Preview”. In my controller for this form, I do different things based on params\[:commit\]. But somehow the params\[:commit\] always evals “Save”, even when I click Previ…

---

## [Link/url helper with/for plugin routes](https://www.ruby-forum.com/t/link-url-helper-with-for-plugin-routes/165334)

<div class="topic-metadata">

**Author:** [@smacks](https://www.ruby-forum.com/u/smacks)\
**Replies:** 0\
**Last updated:** [April 12, 2009, 3:47pm UTC](https://www.ruby-forum.com/t/link-url-helper-with-for-plugin-routes/165334 "2009-04-12T15:47:40Z")

</div>

hi guys, basically following the rails plugin guide, i set up a plugin with routing, controllers, models, etc. now i’d also like to use the link/ url helper to do something like “link\_to pluginName\_path” or “redirect…

---

## [Heroku Garden - reversing or changing a 'generate scaffold' command](https://www.ruby-forum.com/t/heroku-garden-reversing-or-changing-a-generate-scaffold-command/165333)

<div class="topic-metadata">

**Author:** [@clive](https://www.ruby-forum.com/u/clive)\
**Replies:** 0\
**Last updated:** [April 12, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/heroku-garden-reversing-or-changing-a-generate-scaffold-command/165333 "2009-04-12T15:40:03Z")

</div>

In Heroku Garden, is there a way of reversing or changing a ‘generate scaffold’ command? I often find I need to make changes to the scaffolded application but I do not know how to. ‘script/destroy scaffold Modelname’…

---

## [Inserting data from 1 table to another by using find\_by\_sql](https://www.ruby-forum.com/t/inserting-data-from-1-table-to-another-by-using-find-by-sql/165288)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 6\
**Last updated:** [April 12, 2009, 9:58am UTC](https://www.ruby-forum.com/t/inserting-data-from-1-table-to-another-by-using-find-by-sql/165288 "2009-04-12T09:58:29Z")

</div>

Hi All, I am inserting data from one table to another by using following method @data=RoyaltyReportFiles.find\_by\_sql(“insert into royalty\_reports (artist\_name, album\_name) select artist\_name, album\_name from temp\_roy…

---

## [Rails or separate packages, RedHat](https://www.ruby-forum.com/t/rails-or-separate-packages-redhat/164783)

<div class="topic-metadata">

**Author:** [@robredford](https://www.ruby-forum.com/u/robredford)\
**Replies:** 6\
**Last updated:** [April 12, 2009, 6:04am UTC](https://www.ruby-forum.com/t/rails-or-separate-packages-redhat/164783 "2009-04-12T06:04:19Z")

</div>

So, as I introduced myself to ActiveRecord, I asked our IT department to install activerecord and this hierarchy popped up on the system: /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/ then I was able to do this irb…

---

## [Many-To-Many relation - Creating all models in the same form](https://www.ruby-forum.com/t/many-to-many-relation-creating-all-models-in-the-same-form/165307)

<div class="topic-metadata">

**Author:** [@felipecsl](https://www.ruby-forum.com/u/felipecsl)\
**Replies:** 2\
**Last updated:** [April 12, 2009, 4:56am UTC](https://www.ruby-forum.com/t/many-to-many-relation-creating-all-models-in-the-same-form/165307 "2009-04-12T04:56:58Z")

</div>

Hello, I want to create a screen similar to the delicious one, where you can assign tags dynamically to the bookmarks, but I don’t have the tags neither the bookmark created before the submit, and all approaches tha…

---

## [Having issues with paperclip, S3, and Aptana Cloud](https://www.ruby-forum.com/t/having-issues-with-paperclip-s3-and-aptana-cloud/165051)

<div class="topic-metadata">

**Author:** [@prichard](https://www.ruby-forum.com/u/prichard)\
**Replies:** 1\
**Last updated:** [April 12, 2009, 3:18am UTC](https://www.ruby-forum.com/t/having-issues-with-paperclip-s3-and-aptana-cloud/165051 "2009-04-12T03:18:06Z")

</div>

I’m using paperclip to allow users to upload an “avatar” (pretty standard). The problem is, it works just fine in development, but when I deploy the app, it will only upload the original image to S3, but not the resiz…

---

## [Trying to use AR with Oracle Instant Client: ruby-oci8 fails to load](https://www.ruby-forum.com/t/trying-to-use-ar-with-oracle-instant-client-ruby-oci8-fails-to-load/165314)

<div class="topic-metadata">

**Author:** [@robredford](https://www.ruby-forum.com/u/robredford)\
**Replies:** 0\
**Last updated:** [April 12, 2009, 2:50am UTC](https://www.ruby-forum.com/t/trying-to-use-ar-with-oracle-instant-client-ruby-oci8-fails-to-load/165314 "2009-04-12T02:50:37Z")

</div>

I am trying to establish a connection to oracle through ruby-oci8 with the intent on using ActiveRecord. I have Oracle instant-client installed in the usual system location. I have these gems installed in my user spac…

---

## [Mysql encoding with rails 2.3.2 and ruby 1.9.1](https://www.ruby-forum.com/t/mysql-encoding-with-rails-2-3-2-and-ruby-1-9-1/163532)

<div class="topic-metadata">

**Author:** [@ruby.freeman](https://www.ruby-forum.com/u/ruby.freeman)\
**Replies:** 15\
**Last updated:** [April 12, 2009, 2:07am UTC](https://www.ruby-forum.com/t/mysql-encoding-with-rails-2-3-2-and-ruby-1-9-1/163532 "2009-04-12T02:07:57Z")

</div>

when I run console with ruby 1.9.1 and rails 2.3.2, and trying to do something like User.first.name.encoding I’m getting #Encoding:ASCII-8BIT, though I’ve set “encoding: utf8” in database.yml any suggestions?

---

## [Anyone know what causes this?](https://www.ruby-forum.com/t/anyone-know-what-causes-this/196936)

<div class="topic-metadata">

**Author:** [@gavin](https://www.ruby-forum.com/u/gavin)\
**Replies:** 1\
**Last updated:** [April 11, 2009, 9:37pm UTC](https://www.ruby-forum.com/t/anyone-know-what-causes-this/196936 "2009-04-11T21:37:10Z")

</div>

In my app I’ve started to get a 500 error whenever trying to post to a create method /!\\ FAILSAFE /!\\ Sat Apr 11 18:42:28 +0100 2009 Status: 500 Internal Server Error string not matched According to the log it does…

---

## [Model Relations](https://www.ruby-forum.com/t/model-relations/165232)

<div class="topic-metadata">

**Author:** [@ephracis](https://www.ruby-forum.com/u/ephracis)\
**Replies:** 3\
**Last updated:** [April 11, 2009, 8:29pm UTC](https://www.ruby-forum.com/t/model-relations/165232 "2009-04-11T20:29:51Z")

</div>

Hi, I am creating my databases and models and I need to use some relationships. I am very new at this so any help or info at all would be great. :slight\_smile: The concept is: There are three resources: people, item…

---

## [Anyone know what causes this?](https://www.ruby-forum.com/t/anyone-know-what-causes-this/165302)

<div class="topic-metadata">

**Author:** [@gavin](https://www.ruby-forum.com/u/gavin)\
**Replies:** 1\
**Last updated:** [April 11, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/anyone-know-what-causes-this/165302 "2009-04-11T20:27:30Z")

</div>

In my app I’ve started to get a 500 error whenever trying to post to a create method /!\\ FAILSAFE /!\\ Sat Apr 11 18:42:28 +0100 2009 Status: 500 Internal Server Error string not matched According to the log it does…

---

## [Multiple models versus one model](https://www.ruby-forum.com/t/multiple-models-versus-one-model/165251)

<div class="topic-metadata">

**Author:** [@tkbeili](https://www.ruby-forum.com/u/tkbeili)\
**Replies:** 6\
**Last updated:** [April 11, 2009, 8:17pm UTC](https://www.ruby-forum.com/t/multiple-models-versus-one-model/165251 "2009-04-11T20:17:32Z")

</div>

Hello, I have a design question concerning my app with Rails. I have two types of users let’s call them Type1 and Type2. They both have very similar attributes but different associations and functionality. So for eve…

---

## [Updated today - number of rows](https://www.ruby-forum.com/t/updated-today-number-of-rows/165283)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 3\
**Last updated:** [April 11, 2009, 5:33pm UTC](https://www.ruby-forum.com/t/updated-today-number-of-rows/165283 "2009-04-11T17:33:01Z")

</div>

How can I get number of rows that was updated “today”? Table: messages (id, title, message, updated\_at)

---

## [Changing URL from domain.com to subdomain.domain.com on login](https://www.ruby-forum.com/t/changing-url-from-domain-com-to-subdomain-domain-com-on-login/165224)

<div class="topic-metadata">

**Author:** [@ram](https://www.ruby-forum.com/u/ram)\
**Replies:** 16\
**Last updated:** [April 11, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/changing-url-from-domain-com-to-subdomain-domain-com-on-login/165224 "2009-04-11T17:13:06Z")

</div>

Hi all, Ive got a login form for users with the fields subdomain, username and password. This is at the URL http://domain.com. When the user submits the form and login is successful, i need the URL to change to http:…

---

## [Has\_one triggers save!?](https://www.ruby-forum.com/t/has-one-triggers-save/165265)

<div class="topic-metadata">

**Author:** [@kojilab](https://www.ruby-forum.com/u/kojilab)\
**Replies:** 1\
**Last updated:** [April 11, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/has-one-triggers-save/165265 "2009-04-11T17:07:50Z")

</div>

Hi, I have a weird behavior where an object association triggers a save when the parent record is not new. My association is polymorphic like this class UserGuideline \< ActiveRecord::Base has\_one :recurring\_task, :…

---

## [\[ANN\] Falcon - powering innovation](https://www.ruby-forum.com/t/ann-falcon-powering-innovation/165294)

<div class="topic-metadata">

**Author:** [@Kless](https://www.ruby-forum.com/u/Kless)\
**Replies:** 0\
**Last updated:** [April 11, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/ann-falcon-powering-innovation/165294 "2009-04-11T16:52:38Z")

</div>

If anybody is interesed in new technologies, you’ll love this new language called Falcon \[1\], which has been open sourced ago little time. Falcon is a scripting engine ready to empower mission-critical multithreaded …

---

## [Plugin for check constraints?](https://www.ruby-forum.com/t/plugin-for-check-constraints/165293)

<div class="topic-metadata">

**Author:** [@marnen](https://www.ruby-forum.com/u/marnen)\
**Replies:** 0\
**Last updated:** [April 11, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/plugin-for-check-constraints/165293 "2009-04-11T16:45:04Z")

</div>

Hi everyone. I have a quick question. I’m wondering if there’s a Rails plugin along the lines of foreign\_key\_migrations, but for check constraints. (I found mig-constraints already, but that’s apparently not maintai…

---

## [Rails application connectivity with mysql](https://www.ruby-forum.com/t/rails-application-connectivity-with-mysql/165285)

<div class="topic-metadata">

**Author:** [@diwyata](https://www.ruby-forum.com/u/diwyata)\
**Replies:** 0\
**Last updated:** [April 11, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/rails-application-connectivity-with-mysql/165285 "2009-04-11T13:27:09Z")

</div>

Hi I install ruby and all gems and created one rails application . When i started app its started but when mysql connection starts, server autometiccaly stoped giving following error. Please help me … =\> Booting WEB…

---

## [Stymied trying to extend AR with Plugin](https://www.ruby-forum.com/t/stymied-trying-to-extend-ar-with-plugin/165279)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 3\
**Last updated:** [April 11, 2009, 11:24am UTC](https://www.ruby-forum.com/t/stymied-trying-to-extend-ar-with-plugin/165279 "2009-04-11T11:24:57Z")

</div>

Lots of code below, since it’s usually the details that matter. Bit of a long one, but I think it’s generic enough to be a good one for the archives. Experimenting with how to extend ActiveRecord. So I picked a little …

---

## [Double Quotes Problem in mysql](https://www.ruby-forum.com/t/double-quotes-problem-in-mysql/165228)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 5\
**Last updated:** [April 11, 2009, 10:48am UTC](https://www.ruby-forum.com/t/double-quotes-problem-in-mysql/165228 "2009-04-11T10:48:42Z")

</div>

Hi All, I am using following code to find the artist @actual\_artist=Artist.find\_by\_name(params\[:record\]\[:artist\_name\]) —Line A my problem is that i receive da ta like params\[:record\]\[:artist\_name\]=“Acg”" so my appl…

---

## [Migration oracle auto\_increment](https://www.ruby-forum.com/t/migration-oracle-auto-increment/165278)

<div class="topic-metadata">

**Author:** [@robredford](https://www.ruby-forum.com/u/robredford)\
**Replies:** 0\
**Last updated:** [April 11, 2009, 7:43am UTC](https://www.ruby-forum.com/t/migration-oracle-auto-increment/165278 "2009-04-11T07:43:00Z")

</div>

I have a schema for ~15 tables in MySQL. I need to migrate it to Oracle though I’ve never used Oracle before. I see that Oracle doesn’t have an auto\_increment built in. One must create a trigger table for each auto…

---

## [Programmatic way to find associations? (ActiveRecord)](https://www.ruby-forum.com/t/programmatic-way-to-find-associations-activerecord/165254)

<div class="topic-metadata">

**Author:** [@gmoniey](https://www.ruby-forum.com/u/gmoniey)\
**Replies:** 2\
**Last updated:** [April 11, 2009, 6:26am UTC](https://www.ruby-forum.com/t/programmatic-way-to-find-associations-activerecord/165254 "2009-04-11T06:26:37Z")

</div>

Is there a programmatic way to find the different associations that an particular model has? For example, if I have the following: class File \< ActiveRecord::Base belongs\_to :directory has\_many :comments end is th…

---

## [Authenticity\_token sent, still InvalidAuthenticityToken](https://www.ruby-forum.com/t/authenticity-token-sent-still-invalidauthenticitytoken/150615)

<div class="topic-metadata">

**Author:** [@t\_anjan](https://www.ruby-forum.com/u/t_anjan)\
**Replies:** 17\
**Last updated:** [April 11, 2009, 4:41am UTC](https://www.ruby-forum.com/t/authenticity-token-sent-still-invalidauthenticitytoken/150615 "2009-04-11T04:41:04Z")

</div>

Hi! To send the authenticity token from flex back to the server, I followed this: http://blog.dt.org/index.php/2008/06/rails-2-flex-3-and-form-authenticity-tokens/ I have two controllers in my rails app. The method d…

---

## [How do I automatically modify a method when accessing it?](https://www.ruby-forum.com/t/how-do-i-automatically-modify-a-method-when-accessing-it/165270)

<div class="topic-metadata">

**Author:** [@Phoenix\_R](https://www.ruby-forum.com/u/Phoenix_R)\
**Replies:** 1\
**Last updated:** [April 11, 2009, 3:26am UTC](https://www.ruby-forum.com/t/how-do-i-automatically-modify-a-method-when-accessing-it/165270 "2009-04-11T03:26:09Z")

</div>

I’m in a weird situation where I’m storing encrypted information in a database. For example, a User.name field would be stored in its encrypted format, so its not human-readable when accessing: User.name =\> “)@Nw0as…

---

## [Multiple workling instances](https://www.ruby-forum.com/t/multiple-workling-instances/163839)

<div class="topic-metadata">

**Author:** [@rwhiten1](https://www.ruby-forum.com/u/rwhiten1)\
**Replies:** 3\
**Last updated:** [April 11, 2009, 1:16am UTC](https://www.ruby-forum.com/t/multiple-workling-instances/163839 "2009-04-11T01:16:10Z")

</div>

Hi, I’m running Starling and Workling to process background jobs. I’ve four instances of starling running on the same server, and I’m trying to get Workling to use them all. However, all of the jobs seem to be queued …

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

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