# Rails

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

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

---

## [Find conditions](https://www.ruby-forum.com/t/find-conditions/137054)

<div class="topic-metadata">

**Author:** [@remco123](https://www.ruby-forum.com/u/remco123)\
**Replies:** 8\
**Last updated:** [May 8, 2008, 5:47pm UTC](https://www.ruby-forum.com/t/find-conditions/137054 "2008-05-08T17:47:39Z")

</div>

This are my models: class Werelddeel \< ActiveRecord::Base has\_many :land, :foreign\_key =\> “werelddeel\_id” set\_table\_name “werelddelen” set\_primary\_key “werelddeel\_id” has\_permalink :zoeknaam def to\_param zoeknaam …

---

## [Rake problem](https://www.ruby-forum.com/t/rake-problem/137017)

<div class="topic-metadata">

**Author:** [@malioboro](https://www.ruby-forum.com/u/malioboro)\
**Replies:** 2\
**Last updated:** [May 8, 2008, 5:41pm UTC](https://www.ruby-forum.com/t/rake-problem/137017 "2008-05-08T17:41:00Z")

</div>

I dont know why it cant execute my rake test. D:\\ruby\\tiesto\>rake test/unit/kantor\_test.rb --trace (in D:/ruby/tiesto) \*\* Invoke test/unit/kantor\_test.rb (first\_time, not\_needed) In my test/unit/kantor\_test.rb requi…

---

## [Params hash is incorrect for nested arrays](https://www.ruby-forum.com/t/params-hash-is-incorrect-for-nested-arrays/136866)

<div class="topic-metadata">

**Author:** [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Replies:** 4\
**Last updated:** [May 8, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/params-hash-is-incorrect-for-nested-arrays/136866 "2008-05-08T17:28:27Z")

</div>

Hi all, I have a problem with a form for multiple models, but I am not sure if I have the right expectations for what “correct behaviour” should be. I am fairly new to rails so I would welcome any advice. Say you hav…

---

## [Setting file permissions with rsync](https://www.ruby-forum.com/t/setting-file-permissions-with-rsync/137063)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 5:12pm UTC](https://www.ruby-forum.com/t/setting-file-permissions-with-rsync/137063 "2008-05-08T17:12:18Z")

</div>

hi, quick question, when using rsync to upload files to a remote server; is it possible to set the file permissions for those files specifically while doing the transfer. so upload new stylesheets and set the permissi…

---

## [Eager loading of association extensions](https://www.ruby-forum.com/t/eager-loading-of-association-extensions/137047)

<div class="topic-metadata">

**Author:** [@yuleven](https://www.ruby-forum.com/u/yuleven)\
**Replies:** 1\
**Last updated:** [May 8, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/eager-loading-of-association-extensions/137047 "2008-05-08T16:58:16Z")

</div>

Hello all, Is it possible to do eager loading of association extensions? That is, the following code produces one SQL query: cat = ProductCategory.find(:first, :include =\> :pricing\_rules) cat.pricing\_rules But if…

---

## [Newbie book recommendations for Rails 2.0](https://www.ruby-forum.com/t/newbie-book-recommendations-for-rails-2-0/136953)

<div class="topic-metadata">

**Author:** [@DDale](https://www.ruby-forum.com/u/DDale)\
**Replies:** 9\
**Last updated:** [May 8, 2008, 4:48pm UTC](https://www.ruby-forum.com/t/newbie-book-recommendations-for-rails-2-0/136953 "2008-05-08T16:48:51Z")

</div>

So Agile rails development (covering rails 2.0) is out In October, in the mean time what book should a newbie (with some asp/asp.net development) buy? Please don’t recommend any Pdfs as I have zero use for anything th…

---

## [Populating a join table through migrations](https://www.ruby-forum.com/t/populating-a-join-table-through-migrations/136898)

<div class="topic-metadata">

**Author:** [@phirefly](https://www.ruby-forum.com/u/phirefly)\
**Replies:** 4\
**Last updated:** [May 8, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/populating-a-join-table-through-migrations/136898 "2008-05-08T16:09:42Z")

</div>

Is it possible to automatically populate a join table with table data through migrations? So far, I have been able to do it with tables as in the following example: class CreateCategories \< ActiveRecord::Migration def…

---

## [How to go to the desired page using pagination](https://www.ruby-forum.com/t/how-to-go-to-the-desired-page-using-pagination/137012)

<div class="topic-metadata">

**Author:** [@vamsi](https://www.ruby-forum.com/u/vamsi)\
**Replies:** 4\
**Last updated:** [May 8, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/how-to-go-to-the-desired-page-using-pagination/137012 "2008-05-08T15:51:54Z")

</div>

Hi all, i used pagination and it is working fine. But i’ve the folloeing problem… For ex: if i’ve 10 pages and each page contains 10 posts.if i delete a post in the 4th page then that post is deleted and the 1st pa…

---

## [Relationship question has\_many](https://www.ruby-forum.com/t/relationship-question-has-many/136958)

<div class="topic-metadata">

**Author:** [@remco123](https://www.ruby-forum.com/u/remco123)\
**Replies:** 9\
**Last updated:** [May 8, 2008, 2:50pm UTC](https://www.ruby-forum.com/t/relationship-question-has-many/136958 "2008-05-08T14:50:26Z")

</div>

2 tables with a has many relationship. Landen can only have one Werelddeel, and Werelddeel can have more then one Landen. Question 1: Is this the model setup good? class Land \< ActiveRecord::Base belongs\_to :wereldde…

---

## [Namespaced routing + AJAX issues](https://www.ruby-forum.com/t/namespaced-routing-ajax-issues/137040)

<div class="topic-metadata">

**Author:** [@banry](https://www.ruby-forum.com/u/banry)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/namespaced-routing-ajax-issues/137040 "2008-05-08T14:31:48Z")

</div>

Hi Im a newbie so please bear with me. I’ve two controllers admin and public. The admin controller inherits from the public controller. I have two problems The controller returns method admin\_admin\_hierarchies\_path n…

---

## [Filtering a templating component](https://www.ruby-forum.com/t/filtering-a-templating-component/137039)

<div class="topic-metadata">

**Author:** [@Burger](https://www.ruby-forum.com/u/Burger)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/filtering-a-templating-component/137039 "2008-05-08T14:27:37Z")

</div>

Hi All! My sample app uses a ‘main’ layout (specified in application controller), so my controllers’ views .rhtml template snippets are included in the template structure (in the rendered page). I would like to filt…

---

## [Wordpress on rails](https://www.ruby-forum.com/t/wordpress-on-rails/137021)

<div class="topic-metadata">

**Author:** [@ripan](https://www.ruby-forum.com/u/ripan)\
**Replies:** 1\
**Last updated:** [May 8, 2008, 2:21pm UTC](https://www.ruby-forum.com/t/wordpress-on-rails/137021 "2008-05-08T14:21:45Z")

</div>

can i use wordpress blogging facility in my rails application. Is there any API or plugin available for that

---

## [Anyone have any docs on installing rubygems 0.9.4 on solaris 10?](https://www.ruby-forum.com/t/anyone-have-any-docs-on-installing-rubygems-0-9-4-on-solaris-10/137029)

<div class="topic-metadata">

**Author:** [@DDale](https://www.ruby-forum.com/u/DDale)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/anyone-have-any-docs-on-installing-rubygems-0-9-4-on-solaris-10/137029 "2008-05-08T13:21:17Z")

</div>

We normally use blastwave to install packages but the latest BW package I can find for rubygems is 0.9.2. Is there and easy way of manually installing rubygems 0.9.4 on solaris 10 to non standard directories?

---

## [Another problem with scaffold](https://www.ruby-forum.com/t/another-problem-with-scaffold/137022)

<div class="topic-metadata">

**Author:** [@stone](https://www.ruby-forum.com/u/stone)\
**Replies:** 1\
**Last updated:** [May 8, 2008, 1:05pm UTC](https://www.ruby-forum.com/t/another-problem-with-scaffold/137022 "2008-05-08T13:05:20Z")

</div>

Hello me another fresh man of ROR also using “agile web development with rails” as a reference book I got problem with scaffold now I use Rails2.0.2,ruby 1.8,apatana platform , generate the products controller and t…

---

## [On 'Back' button of browser, drop down doesn't get refreshed](https://www.ruby-forum.com/t/on-back-button-of-browser-drop-down-doesnt-get-refreshed/137026)

<div class="topic-metadata">

**Author:** [@shikha](https://www.ruby-forum.com/u/shikha)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 12:41pm UTC](https://www.ruby-forum.com/t/on-back-button-of-browser-drop-down-doesnt-get-refreshed/137026 "2008-05-08T12:41:36Z")

</div>

Hey guys, i have a drop down in my UI, which value gets filled by session\[:sale\]. \<%= select\_tag :sale\_id, options\_for\_select(\[\[“Select Sale”, “0”\]\] + @sales.collect { |s| \[s.name, s.name\] }, selected = session\[:salei…

---

## [Design question](https://www.ruby-forum.com/t/design-question/136888)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 2\
**Last updated:** [May 8, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/design-question/136888 "2008-05-08T12:25:16Z")

</div>

Hi, I’m developing a budget planner for myself and do have a table for recurring expenses, as well as a transaction table for my bank account CSV file uploads. Questions: For the projections forward in time I’m wond…

---

## [Scriplets are not working](https://www.ruby-forum.com/t/scriplets-are-not-working/136945)

<div class="topic-metadata">

**Author:** [@vijay](https://www.ruby-forum.com/u/vijay)\
**Replies:** 16\
**Last updated:** [May 8, 2008, 11:46am UTC](https://www.ruby-forum.com/t/scriplets-are-not-working/136945 "2008-05-08T11:46:33Z")

</div>

Newbie to Ruby, working on examples Agile Development with Rails2. Addition: \<%= 1+2 %\> Concatenation: \<%= "cow" + "boy" %\> 1.hour.from\_now Time in one hour: \<%= 1.hour.from\_now %\> this code simplly prints like this …

---

## [File\_field doesn't show filename on edit](https://www.ruby-forum.com/t/file-field-doesnt-show-filename-on-edit/136952)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 2\
**Last updated:** [May 8, 2008, 11:33am UTC](https://www.ruby-forum.com/t/file-field-doesnt-show-filename-on-edit/136952 "2008-05-08T11:33:05Z")

</div>

hi everyone- If I add a file\_field to a form, and on create, the model fails to save for some error, I then redirect back to edit, every other field shows up on the form, except file\_field’s. This becomes tedious to …

---

## [Problem with collection\_select](https://www.ruby-forum.com/t/problem-with-collection-select/137023)

<div class="topic-metadata">

**Author:** [@williamn](https://www.ruby-forum.com/u/williamn)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 11:28am UTC](https://www.ruby-forum.com/t/problem-with-collection-select/137023 "2008-05-08T11:28:59Z")

</div>

Hi all. I have a problem with collection\_select, hope you guys can help me. User has one Address, and Address has one Province. Here are my models : models/user.rb class User \< ActiveRecord::Base has\_one :address, …

---

## [Help about speed test in Agile Web Development 2nd](https://www.ruby-forum.com/t/help-about-speed-test-in-agile-web-development-2nd/137013)

<div class="topic-metadata">

**Author:** [@smellcode](https://www.ruby-forum.com/u/smellcode)\
**Replies:** 1\
**Last updated:** [May 8, 2008, 11:18am UTC](https://www.ruby-forum.com/t/help-about-speed-test-in-agile-web-development-2nd/137013 "2008-05-08T11:18:47Z")

</div>

in chapter 13 def test\_100\_orders Order.delete\_all LineItem.delete\_all @controller.logger.silence do elapsed\_time = Benchmark.realtime do 100.downto(1) do |prd\_id| cart = Cart.new cart.add\_product(…

---

## [Introducing ResourcefulViews 0.1](https://www.ruby-forum.com/t/introducing-resourcefulviews-0-1/136861)

<div class="topic-metadata">

**Author:** [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Replies:** 3\
**Last updated:** [May 8, 2008, 11:18am UTC](https://www.ruby-forum.com/t/introducing-resourcefulviews-0-1/136861 "2008-05-08T11:18:11Z")

</div>

Hi all, today I am releasing ResourcefulViews 0.1, a Rails plugin that I have been working on lately. ResoursefulViews started as a simple naming convention for CSS classes that we began using at twinity.com a while …

---

## [Database Timeout with SQL Server](https://www.ruby-forum.com/t/database-timeout-with-sql-server/137020)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 11:10am UTC](https://www.ruby-forum.com/t/database-timeout-with-sql-server/137020 "2008-05-08T11:10:28Z")

</div>

Hi, I keep getting databse timeout errors messages while running queries on my site. It is a large database but is there anyway to handle this using sqlserver by increasing the timout value or something? JB

---

## [Running tests with textmate](https://www.ruby-forum.com/t/running-tests-with-textmate/137019)

<div class="topic-metadata">

**Author:** [@leethal](https://www.ruby-forum.com/u/leethal)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 10:50am UTC](https://www.ruby-forum.com/t/running-tests-with-textmate/137019 "2008-05-08T10:50:27Z")

</div>

What’s up with tests doing require ‘test\_helper’ instead of require File.dirname(FILE) + ‘/…/test\_helper’ in edge rails, so that running test files in textmate doesn’t work?

---

## [Problem with collection\_select](https://www.ruby-forum.com/t/problem-with-collection-select/137016)

<div class="topic-metadata">

**Author:** [@williamn](https://www.ruby-forum.com/u/williamn)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 10:38am UTC](https://www.ruby-forum.com/t/problem-with-collection-select/137016 "2008-05-08T10:38:14Z")

</div>

hi all… here are my problem: user has one address and address has one province. how can i use collection\_select to show list of provinces in user controller? i try @provinces = Province.find(:all) but i got this err…

---

## [Yields and blocks in Rails](https://www.ruby-forum.com/t/yields-and-blocks-in-rails/136976)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [May 8, 2008, 9:54am UTC](https://www.ruby-forum.com/t/yields-and-blocks-in-rails/136976 "2008-05-08T09:54:31Z")

</div>

The below code works just fine in Ruby but I get a LocalJumpError in Rails stating “no block given”. I thought I knew what a block was, but given the results, I am not so sure. Could someone please offer an explanatio…

---

## [Flashing Notice from a Model Throws Error](https://www.ruby-forum.com/t/flashing-notice-from-a-model-throws-error/196673)

<div class="topic-metadata">

**Author:** [@wickNbomb](https://www.ruby-forum.com/u/wickNbomb)\
**Replies:** 3\
**Last updated:** [May 8, 2008, 9:46am UTC](https://www.ruby-forum.com/t/flashing-notice-from-a-model-throws-error/196673 "2008-05-08T09:46:31Z")

</div>

I have a view (list\_users) that calls destroy\_user and I’d like to get it to flash an error within the view. The code below works for the raise, but if I comment it out and try the 2 lines below it, I get the followin…

---

## [Prob with migration](https://www.ruby-forum.com/t/prob-with-migration/136910)

<div class="topic-metadata">

**Author:** [@Ashit\_V](https://www.ruby-forum.com/u/Ashit_V)\
**Replies:** 3\
**Last updated:** [May 8, 2008, 9:43am UTC](https://www.ruby-forum.com/t/prob-with-migration/136910 "2008-05-08T09:43:16Z")

</div>

I saw the same problem posted earlier too on this group but still didnt find any solution… I created a new database and a table. when I tried the comman rake migration it says “Rake Aborted! Dont know how to build …

---

## [Stub sub partials when testing partial with rspec](https://www.ruby-forum.com/t/stub-sub-partials-when-testing-partial-with-rspec/137015)

<div class="topic-metadata">

**Author:** [@Goremika](https://www.ruby-forum.com/u/Goremika)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 9:43am UTC](https://www.ruby-forum.com/t/stub-sub-partials-when-testing-partial-with-rspec/137015 "2008-05-08T09:43:16Z")

</div>

Hello all I prefer to use many partials. It makes my code more DRY Also I use rspec, and when I have to test partial with sub partials I have a problem. if I stub render, then my partial will not be rendered. If i do…

---

## [Opening the Time Class](https://www.ruby-forum.com/t/opening-the-time-class/136752)

<div class="topic-metadata">

**Author:** [@jules](https://www.ruby-forum.com/u/jules)\
**Replies:** 3\
**Last updated:** [May 8, 2008, 9:42am UTC](https://www.ruby-forum.com/t/opening-the-time-class/136752 "2008-05-08T09:42:39Z")

</div>

I’m trying to add some extra methods to the time class by opening it up like this: class Time # opening up ruby time ONE\_DAY\_IN\_SECS = 86400 def self.yesterday\_at\_midnight(today = Time.now) time\_yesterday = today.to…

---

## [Controller/action not working in url](https://www.ruby-forum.com/t/controller-action-not-working-in-url/137009)

<div class="topic-metadata">

**Author:** [@shikha](https://www.ruby-forum.com/u/shikha)\
**Replies:** 0\
**Last updated:** [May 8, 2008, 7:41am UTC](https://www.ruby-forum.com/t/controller-action-not-working-in-url/137009 "2008-05-08T07:41:13Z")

</div>

Hey guys, i am facing some problems in calling an action. see details: in sale\_items controller, i have a function def saleedit –code– render ( :action =\> ‘saleedit’) end and i have a file in view/sale\_items/salee…

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

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