# Rails

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

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

---

## [Help on drying code](https://www.ruby-forum.com/t/help-on-drying-code/122593)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [December 9, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/help-on-drying-code/122593 "2007-12-09T23:47:18Z")

</div>

Hi all, Currently I’m having to do this: def self.authorized\_roles(controller, action) specific = self.find\_by\_controller\_and\_action(controller, action) all\_actions = self.find\_by\_controller\_and\_action(controller, ‘’…

---

## [Re: Managing Hierarchical Data](https://www.ruby-forum.com/t/re-managing-hierarchical-data/122595)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/re-managing-hierarchical-data/122595 "2007-12-09T23:43:48Z")

</div>

You are probably looking for “acts\_as\_tree” (google for details). –MarkusQ Sent via BlackBerry from T-Mobile

---

## [Good online Ruby tutorial? (for learning basic Ruby syntax)](https://www.ruby-forum.com/t/good-online-ruby-tutorial-for-learning-basic-ruby-syntax/122547)

<div class="topic-metadata">

**Author:** [@Action](https://www.ruby-forum.com/u/Action)\
**Replies:** 4\
**Last updated:** [December 9, 2007, 11:41pm UTC](https://www.ruby-forum.com/t/good-online-ruby-tutorial-for-learning-basic-ruby-syntax/122547 "2007-12-09T23:41:22Z")

</div>

I’m a CakePHP developer looking to give Ruby on Rails a try. I’ve never programmed in Ruby in before, so I need to learn enough of the language to jump into Rails. Are there any good online books/tutorials/ guides tha…

---

## [Adding To View Path - Not Picking Up Templates?](https://www.ruby-forum.com/t/adding-to-view-path-not-picking-up-templates/122594)

<div class="topic-metadata">

**Author:** [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 11:35pm UTC](https://www.ruby-forum.com/t/adding-to-view-path-not-picking-up-templates/122594 "2007-12-09T23:35:37Z")

</div>

So, I’m adding a secondary template location to ActionController’s view\_paths so that I can dynamically choose the render path (basic ‘theme’ support). I can see that ActionController::Base.view\_paths contains my new …

---

## [One module for two 'super' controllers](https://www.ruby-forum.com/t/one-module-for-two-super-controllers/122556)

<div class="topic-metadata">

**Author:** [@Erwin](https://www.ruby-forum.com/u/Erwin)\
**Replies:** 3\
**Last updated:** [December 9, 2007, 11:35pm UTC](https://www.ruby-forum.com/t/one-module-for-two-super-controllers/122556 "2007-12-09T23:35:02Z")

</div>

Hi, I have two plugins with rails active-rbac and actionflow. Actionflow uses his own controller, so I have two super controllers one for the application (ApplicationController) and one for actionflow (FlowApplicatio…

---

## [Managing Hierarchical Data](https://www.ruby-forum.com/t/managing-hierarchical-data/122584)

<div class="topic-metadata">

**Author:** [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Replies:** 2\
**Last updated:** [December 9, 2007, 11:20pm UTC](https://www.ruby-forum.com/t/managing-hierarchical-data/122584 "2007-12-09T23:20:38Z")

</div>

Hello, I am in the process of trying to date hierarchical data in a MySQL database and convert it into a treeview view JS scripting. As a beginner to ROR there are still many unknown things to me, and handling this so…

---

## [Net::HTTP](https://www.ruby-forum.com/t/net-http/122543)

<div class="topic-metadata">

**Author:** [@doug](https://www.ruby-forum.com/u/doug)\
**Replies:** 1\
**Last updated:** [December 9, 2007, 10:43pm UTC](https://www.ruby-forum.com/t/net-http/122543 "2007-12-09T22:43:34Z")

</div>

The Net::HTTP class has a post\_form method. However, if I create an instance of that class (e.g., my\_instance=Net::HTTP.new(‘url’,port), I can’t seem to access the post\_form method of the instance. (I would expect t…

---

## [Creating intances of a model with two required foreign keys](https://www.ruby-forum.com/t/creating-intances-of-a-model-with-two-required-foreign-keys/122540)

<div class="topic-metadata">

**Author:** [@tomn](https://www.ruby-forum.com/u/tomn)\
**Replies:** 2\
**Last updated:** [December 9, 2007, 9:23pm UTC](https://www.ruby-forum.com/t/creating-intances-of-a-model-with-two-required-foreign-keys/122540 "2007-12-09T21:23:34Z")

</div>

I asked this the other day but perhaps in too wordy a way. I have a Student model, a Course\_offering model, and a Course\_record model ( a table with columns for grades in midterms, final , lab etc). The course\_record …

---

## [Nested find](https://www.ruby-forum.com/t/nested-find/122569)

<div class="topic-metadata">

**Author:** [@jney](https://www.ruby-forum.com/u/jney)\
**Replies:** 2\
**Last updated:** [December 9, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/nested-find/122569 "2007-12-09T21:05:02Z")

</div>

hi, i want to do it with activerecords: parent.children.my\_method. in “my\_method” i have a find\_by\_sql and need to know “parent” attributes. how do i get them? regards

---

## [Routing Problem using 2.0.1](https://www.ruby-forum.com/t/routing-problem-using-2-0-1/122555)

<div class="topic-metadata">

**Author:** [@bbebop](https://www.ruby-forum.com/u/bbebop)\
**Replies:** 4\
**Last updated:** [December 9, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/routing-problem-using-2-0-1/122555 "2007-12-09T20:58:00Z")

</div>

I’ve run into a problem upgrading an app to rails 2.0.1. All of this worked under 1.2.6, but I’m not sure if the problem is caused by a bug or changed behavior in 2.0.1. this routing: map.resources :bands do |t| t.r…

---

## [Rails big pain - uploads and plugin versioning](https://www.ruby-forum.com/t/rails-big-pain-uploads-and-plugin-versioning/122554)

<div class="topic-metadata">

**Author:** [@Nowy](https://www.ruby-forum.com/u/Nowy)\
**Replies:** 3\
**Last updated:** [December 9, 2007, 8:29pm UTC](https://www.ruby-forum.com/t/rails-big-pain-uploads-and-plugin-versioning/122554 "2007-12-09T20:29:06Z")

</div>

First of all, congratulations, for rails 2.0 !. I just want to ask two short questions: Any plans to improve file uploads ? (now single upload block my entire mongrel process) Or any alternatives ? What about plugin …

---

## [How to rebuild database with capistrano](https://www.ruby-forum.com/t/how-to-rebuild-database-with-capistrano/117970)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 4\
**Last updated:** [December 9, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/how-to-rebuild-database-with-capistrano/117970 "2007-12-09T18:17:37Z")

</div>

I’ve deployed an application using Capistrano. But on my local machine I edited one of the earlier migrations. I’ve tried “cap deploy\_with\_migrations”, but it looks like it didn’t rebuild the database. How can I do …

---

## [New to ruby Please help me](https://www.ruby-forum.com/t/new-to-ruby-please-help-me/122553)

<div class="topic-metadata">

**Author:** [@Mail\_from\_RAMU](https://www.ruby-forum.com/u/Mail_from_RAMU)\
**Replies:** 5\
**Last updated:** [December 9, 2007, 6:08pm UTC](https://www.ruby-forum.com/t/new-to-ruby-please-help-me/122553 "2007-12-09T18:08:52Z")

</div>

Hi All, I am very new to Ruby programming language and I am very much interested by looking at the demos of Ruby and Ruby on Rails. I want to learn the nuts and bolts of Ruby as quickly as possible. Please help me i…

---

## [\[ANN/ADV\] Rails training from Ruby Power and Light in NYC, February 2008!](https://www.ruby-forum.com/t/ann-adv-rails-training-from-ruby-power-and-light-in-nyc-february-2008/122575)

<div class="topic-metadata">

**Author:** [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/ann-adv-rails-training-from-ruby-power-and-light-in-nyc-february-2008/122575 "2007-12-09T17:53:03Z")

</div>

Hello all – I’m happy to announce that Ruby Power and Light is offering the following Ruby on Rails training courses in New York City in February: \* Intro to Rails, New York, NY, February 4-7 2008 \* Advancing With R…

---

## [Model loading test and different load\_paths orders](https://www.ruby-forum.com/t/model-loading-test-and-different-load-paths-orders/122567)

<div class="topic-metadata">

**Author:** [@Sven\_F](https://www.ruby-forum.com/u/Sven_F)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/model-loading-test-and-different-load-paths-orders/122567 "2007-12-09T15:59:44Z")

</div>

I think that I’ve found the problem that causes the last test in model\_and\_lib\_test.rb to fail. http://svn.rails-engines.org/test/engines/rails\_2.0/test/unit/model\_and\_lib\_test.rb The problem is: with two models Somet…

---

## [Bug or feature? rhtml file is not using the overwritten accessor of ActiveRecord class](https://www.ruby-forum.com/t/bug-or-feature-rhtml-file-is-not-using-the-overwritten-accessor-of-activerecord-class/122565)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 2:52pm UTC](https://www.ruby-forum.com/t/bug-or-feature-rhtml-file-is-not-using-the-overwritten-accessor-of-activerecord-class/122565 "2007-12-09T14:52:24Z")

</div>

Hi, I was wondering about a quite strange behaviour in RoR: I overwrote the default accessors for the “duration” field of my ActiveRecord class “Task” to do some conversion. In my View in the rhtml file, I tried to u…

---

## [Creating AJAX on the fly](https://www.ruby-forum.com/t/creating-ajax-on-the-fly/122532)

<div class="topic-metadata">

**Author:** [@raimon](https://www.ruby-forum.com/u/raimon)\
**Replies:** 2\
**Last updated:** [December 9, 2007, 11:18am UTC](https://www.ruby-forum.com/t/creating-ajax-on-the-fly/122532 "2007-12-09T11:18:37Z")

</div>

I have two drop-down menus in a page. the first has only two values, and when one of those two values is selected, an AJAX call is made to RoR. there, I fetch some rows from the database, and fill the second drop-dow…

---

## [Rails version error - related to PATH?](https://www.ruby-forum.com/t/rails-version-error-related-to-path/121607)

<div class="topic-metadata">

**Author:** [@n1c](https://www.ruby-forum.com/u/n1c)\
**Replies:** 5\
**Last updated:** [December 9, 2007, 10:37am UTC](https://www.ruby-forum.com/t/rails-version-error-related-to-path/121607 "2007-12-09T10:37:42Z")

</div>

Hi all I followed these instructions some a few weeks ago to get Rails up and running on my Mac. No problems. Then I had some wierd issues to my PATH being forgotten about a week ago, which I managed to resolve (don…

---

## [Umlaut problem after Caching](https://www.ruby-forum.com/t/umlaut-problem-after-caching/122552)

<div class="topic-metadata">

**Author:** [@song](https://www.ruby-forum.com/u/song)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 9:22am UTC](https://www.ruby-forum.com/t/umlaut-problem-after-caching/122552 "2007-12-09T09:22:19Z")

</div>

Hi! My website use caching. The first visit after deleting caching files in public/, alls seems okay. But when i revisit the site (cache is activited), all umlauts (german special chars) are damaged (Ã¼ber =\> ÃƒÂ¼ber…

---

## [Fabulous search routine from RailsSpace but missing 'LIKE' strategy?](https://www.ruby-forum.com/t/fabulous-search-routine-from-railsspace-but-missing-like-strategy/122548)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 6:14am UTC](https://www.ruby-forum.com/t/fabulous-search-routine-from-railsspace-but-missing-like-strategy/122548 "2007-12-09T06:14:00Z")

</div>

I’m having a wonderful time with the RailsSpace book and using their ‘browse’ example to fashion my queries. Does anyone know how/if I can include a LIKE statement using this strategy? I’ve been searching the web all …

---

## [Straight join in rails](https://www.ruby-forum.com/t/straight-join-in-rails/122546)

<div class="topic-metadata">

**Author:** [@Esad\_H](https://www.ruby-forum.com/u/Esad_H)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 5:58am UTC](https://www.ruby-forum.com/t/straight-join-in-rails/122546 "2007-12-09T05:58:13Z")

</div>

Maybe someone will find this useful: I have a relatively complex (My)SQL query that results from having many many :conditions and :includes, and MySQL seems to apply a wrong join order so I wanted to force an order us…

---

## [Active Record, Migration, and Translation](https://www.ruby-forum.com/t/active-record-migration-and-translation/122188)

<div class="topic-metadata">

**Author:** [@SSSSSbastien\_Lamy](https://www.ruby-forum.com/u/SSSSSbastien_Lamy)\
**Replies:** 5\
**Last updated:** [December 8, 2007, 10:32pm UTC](https://www.ruby-forum.com/t/active-record-migration-and-translation/122188 "2007-12-08T22:32:26Z")

</div>

Hi, I think the columns and table in migration should be able to have an optional “display\_name” set manually. Something like: create\_table :people, {display\_name =\> “Personne”} do |t| t.column :first\_name :string, :…

---

## [Partials](https://www.ruby-forum.com/t/partials/122528)

<div class="topic-metadata">

**Author:** [@gadys](https://www.ruby-forum.com/u/gadys)\
**Replies:** 3\
**Last updated:** [December 8, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/partials/122528 "2007-12-08T21:42:28Z")

</div>

Hi I’m trying to render a partial but i recive an unexpected result. why isn’t the id of the menupage isn’t generated in the link ? Thanks! here is the code : controller : @menupages = @site.pages @menupages = Page…

---

## [Rails 2.0.1 initializer weird infinite loop situation](https://www.ruby-forum.com/t/rails-2-0-1-initializer-weird-infinite-loop-situation/122526)

<div class="topic-metadata">

**Author:** [@ptontiger](https://www.ruby-forum.com/u/ptontiger)\
**Replies:** 4\
**Last updated:** [December 8, 2007, 9:01pm UTC](https://www.ruby-forum.com/t/rails-2-0-1-initializer-weird-infinite-loop-situation/122526 "2007-12-08T21:01:56Z")

</div>

Just switched an app over from 1.2 to 2.0. In accordance with the new convention, I moved my custom configuration information out of config/environment.rb and into config/initializers/ app\_config.rb. I found that my a…

---

## [Questions on acts\_as\_versioned](https://www.ruby-forum.com/t/questions-on-acts-as-versioned/122511)

<div class="topic-metadata">

**Author:** [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Replies:** 1\
**Last updated:** [December 8, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/questions-on-acts-as-versioned/122511 "2007-12-08T19:18:12Z")

</div>

Thanks, Rick, for a great plugin. But one thgn leads to another, sort of like pulling at the thread in the willy jumper … :slight\_smile: Three questions about acts\_as\_versioned; the second leads to other issues. u…

---

## [Connect to MS Access Database?](https://www.ruby-forum.com/t/connect-to-ms-access-database/122229)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 2\
**Last updated:** [December 8, 2007, 6:09pm UTC](https://www.ruby-forum.com/t/connect-to-ms-access-database/122229 "2007-12-08T18:09:40Z")

</div>

Can RoR easily connect and modify an Access database? Also can RoR be used to easily create a web application that is just accessed over an intranet?

---

## [ActionWebService in Rails 2.0](https://www.ruby-forum.com/t/actionwebservice-in-rails-2-0/122516)

<div class="topic-metadata">

**Author:** [@joachimgross](https://www.ruby-forum.com/u/joachimgross)\
**Replies:** 0\
**Last updated:** [December 8, 2007, 5:33pm UTC](https://www.ruby-forum.com/t/actionwebservice-in-rails-2-0/122516 "2007-12-08T17:33:30Z")

</div>

Hello, I tried upgrading my application from 1.2.6 to 2.0.1. One thing that doesn’t work is ActionWebService. As stated in this blog: http://weblog.rubyonrails.com/2007/12/7/rails-2-0-it-s-done I did a gem install …

---

## [Acts\_as\_rated error](https://www.ruby-forum.com/t/acts-as-rated-error/122383)

<div class="topic-metadata">

**Author:** [@rubynuby](https://www.ruby-forum.com/u/rubynuby)\
**Replies:** 1\
**Last updated:** [December 8, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/acts-as-rated-error/122383 "2007-12-08T17:01:50Z")

</div>

I’m trying to use acts\_as\_rated and getting this error: Mysql::Error: #42S22Unknown column ‘ratings.post\_id’ in ‘where clause’: SELECT \* FROM ratings WHERE (ratings.post\_id = 14 AND (rater\_id = 2)) LIMIT 1 not sure …

---

## [Trying to run db:test:prepare (newbie)](https://www.ruby-forum.com/t/trying-to-run-dbprepare-newbie/122508)

<div class="topic-metadata">

**Author:** [@statictony](https://www.ruby-forum.com/u/statictony)\
**Replies:** 0\
**Last updated:** [December 8, 2007, 2:32pm UTC](https://www.ruby-forum.com/t/trying-to-run-dbprepare-newbie/122508 "2007-12-08T14:32:04Z")

</div>

Ok, liking rails so far, can see its benefits. But I’m now trying to figure out the testing side of things. When I try and run rake db:test:prepare I get this error ‘dropdb’ is not recognized as an internal or extern…

---

## [One-to-many through scaffolding?](https://www.ruby-forum.com/t/one-to-many-through-scaffolding/122506)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 3\
**Last updated:** [December 8, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/one-to-many-through-scaffolding/122506 "2007-12-08T14:26:08Z")

</div>

I’m working on my first one-to-many. Through scaffolds I have CRUD interfaces for the “feeds” and “items” tables. I have everything configured for a one-to-many O/R mapping, to my knowledge. Is there a scaffold comm…

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

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