# Rails

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

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

---

## [Not able to do find on associations in rails3](https://www.ruby-forum.com/t/not-able-to-do-find-on-associations-in-rails3/188363)

<div class="topic-metadata">

**Author:** [@Nadal](https://www.ruby-forum.com/u/Nadal)\
**Replies:** 3\
**Last updated:** [May 10, 2010, 11:13pm UTC](https://www.ruby-forum.com/t/not-able-to-do-find-on-associations-in-rails3/188363 "2010-05-10T23:13:08Z")

</div>

I am using rails3 edge. class user \< AR has\_many :books end Following statement is failing in console. User.first.books.find(:conditions =\> {:title =\> ‘ror’}) ActiveRecord::RecordNotFound: Couldn’t find Book withou…

---

## [Table naming question](https://www.ruby-forum.com/t/table-naming-question/188362)

<div class="topic-metadata">

**Author:** [@matthew](https://www.ruby-forum.com/u/matthew)\
**Replies:** 1\
**Last updated:** [May 10, 2010, 11:06pm UTC](https://www.ruby-forum.com/t/table-naming-question/188362 "2010-05-10T23:06:07Z")

</div>

Conisdering the naming conventions of ActiveRecord tables… I have a parent table called “Jobs” and a child table to it called “JobItems” which holds the line items on any give “Job” that we process. Now I’m dealing wi…

---

## [Ruby on Rails Associations - Practical Applications](https://www.ruby-forum.com/t/ruby-on-rails-associations-practical-applications/188327)

<div class="topic-metadata">

**Author:** [@cam](https://www.ruby-forum.com/u/cam)\
**Replies:** 3\
**Last updated:** [May 10, 2010, 10:13pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-associations-practical-applications/188327 "2010-05-10T22:13:54Z")

</div>

Hey All, Forgive me for posting a question that may be very elementary. I’m building an application and am a bit stuck on how to work out the associations. It goes like this: User :has\_many vehicles User :has\_many l…

---

## [Request advice on best/usable field default](https://www.ruby-forum.com/t/request-advice-on-best-usable-field-default/188353)

<div class="topic-metadata">

**Author:** [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Replies:** 7\
**Last updated:** [May 10, 2010, 10:03pm UTC](https://www.ruby-forum.com/t/request-advice-on-best-usable-field-default/188353 "2010-05-10T22:03:58Z")

</div>

Hi all, I am creating a bash.org-like. Basically: just store and retrieve quotes that people enter. I would like the user to have the option of entering a few fields, among which are a date a and location field. What…

---

## [Error when Generating a resource, controller or scaffold - Rails 3 beta3](https://www.ruby-forum.com/t/error-when-generating-a-resource-controller-or-scaffold-rails-3-beta3/186983)

<div class="topic-metadata">

**Author:** [@rodrigo3n](https://www.ruby-forum.com/u/rodrigo3n)\
**Replies:** 3\
**Last updated:** [May 10, 2010, 9:40pm UTC](https://www.ruby-forum.com/t/error-when-generating-a-resource-controller-or-scaffold-rails-3-beta3/186983 "2010-05-10T21:40:03Z")

</div>

Hello everyone, I just installed Rails 3 beta3 and when attempting to create anything from the Rails generator I get this error: ~/code/blog% rails g resource post title:string content:text /home/rodrigo3n/.rvm/gems/r…

---

## [Visit a url programatically](https://www.ruby-forum.com/t/visit-a-url-programatically/188352)

<div class="topic-metadata">

**Author:** [@kevid](https://www.ruby-forum.com/u/kevid)\
**Replies:** 2\
**Last updated:** [May 10, 2010, 8:40pm UTC](https://www.ruby-forum.com/t/visit-a-url-programatically/188352 "2010-05-10T20:40:56Z")

</div>

hi all, i have the code below; require ‘rexml/document’ require ‘open-uri’ open(‘http://api.evdb.com/rest/users/login?app\_key=ct2hJqTCg4XLCP5h’) { |f| $res = REXML::Document.new(f.read) } the xml data that is rea…

---

## [Noob question on passing parameters in the url](https://www.ruby-forum.com/t/noob-question-on-passing-parameters-in-the-url/188346)

<div class="topic-metadata">

**Author:** [@Lille](https://www.ruby-forum.com/u/Lille)\
**Replies:** 2\
**Last updated:** [May 10, 2010, 7:07pm UTC](https://www.ruby-forum.com/t/noob-question-on-passing-parameters-in-the-url/188346 "2010-05-10T19:07:15Z")

</div>

Hi, What are the requirements for passing parameters in the url across any controller/action combinations? \[from controller A…\] redirect\_to controller\_b\_action1\_url(:desired\_param=\>‘desired value’) \[now from B#1…\] r…

---

## [Routing problem with beginner tutorial app](https://www.ruby-forum.com/t/routing-problem-with-beginner-tutorial-app/188328)

<div class="topic-metadata">

**Author:** [@mattn](https://www.ruby-forum.com/u/mattn)\
**Replies:** 2\
**Last updated:** [May 10, 2010, 7:05pm UTC](https://www.ruby-forum.com/t/routing-problem-with-beginner-tutorial-app/188328 "2010-05-10T19:05:32Z")

</div>

I’m just getting started with Rails 2. Plus, it’s been a while since I played with Rails at all. So to explore, I whipped out an old Rails tutorial (from an O’Reilly book) and started going through it, to refresh my m…

---

## [Convert accentend chars to their base](https://www.ruby-forum.com/t/convert-accentend-chars-to-their-base/188334)

<div class="topic-metadata">

**Author:** [@eugenio](https://www.ruby-forum.com/u/eugenio)\
**Replies:** 5\
**Last updated:** [May 10, 2010, 4:34pm UTC](https://www.ruby-forum.com/t/convert-accentend-chars-to-their-base/188334 "2010-05-10T16:34:12Z")

</div>

is there a good way to convert “special” accented chars to their base chars? as an example i want “àéìòù” =\> “aeiou” i’m using several gsub now “àèìòù”.gsub(“à”,“a”).gsub(“è”,“e”).gsub(“ì”,“i”)… it works but i wonde…

---

## [NilClass passed to partial view](https://www.ruby-forum.com/t/nilclass-passed-to-partial-view/188342)

<div class="topic-metadata">

**Author:** [@rubygreg](https://www.ruby-forum.com/u/rubygreg)\
**Replies:** 7\
**Last updated:** [May 10, 2010, 4:32pm UTC](https://www.ruby-forum.com/t/nilclass-passed-to-partial-view/188342 "2010-05-10T16:32:37Z")

</div>

Hi, I have a simple program that tries to do something really basic. First, I have a company Model : class Company \< ActiveRecord::Base has\_one :billingAddress, :foreign\_key=\>“id”, :class\_name=\>“Address” end Then I …

---

## [Applying a patch](https://www.ruby-forum.com/t/applying-a-patch/188034)

<div class="topic-metadata">

**Author:** [@Mlle](https://www.ruby-forum.com/u/Mlle)\
**Replies:** 4\
**Last updated:** [May 10, 2010, 4:32pm UTC](https://www.ruby-forum.com/t/applying-a-patch/188034 "2010-05-10T16:32:12Z")

</div>

Hello, I’ve never applied a patch before and would like to know how to do it. How do I apply the " erb\_encoding\_workaround.patch" from : https://rails.lighthouseapp.com/projects/8994/tickets/2188-i18n-fails-with-multi…

---

## [The view is important](https://www.ruby-forum.com/t/the-view-is-important/188285)

<div class="topic-metadata">

**Author:** [@Pau](https://www.ruby-forum.com/u/Pau)\
**Replies:** 1\
**Last updated:** [May 10, 2010, 4:31pm UTC](https://www.ruby-forum.com/t/the-view-is-important/188285 "2010-05-10T16:31:15Z")

</div>

I have been developing web applications for only 4 years but this has been enough to know that HTML+CSS+Javascript is the hardest part. Nowadays there exists many javascript libraries such as jQuery and some javascrip…

---

## [De-crypting Ruby password with php](https://www.ruby-forum.com/t/de-crypting-ruby-password-with-php/188337)

<div class="topic-metadata">

**Author:** [@rusty](https://www.ruby-forum.com/u/rusty)\
**Replies:** 6\
**Last updated:** [May 10, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/de-crypting-ruby-password-with-php/188337 "2010-05-10T16:26:13Z")

</div>

Hello all, I have a client with an older Rails 1.8 app (was recently upgraded from 1.6) and I need to integrate a php site to use the same user login creds. I’m not very versed with Ruby but I think this is the code t…

---

## [Best way to model this](https://www.ruby-forum.com/t/best-way-to-model-this/188339)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 2\
**Last updated:** [May 10, 2010, 3:23pm UTC](https://www.ruby-forum.com/t/best-way-to-model-this/188339 "2010-05-10T15:23:35Z")

</div>

Let’s say I have a car table that has many passengers so obviously the passenger table will have a foreign key to car. The Car model has\_many Passengers. A car can have one and only one driver. What’s the best way …

---

## [Link\_to :remote with parameters not working in Rails 3?](https://www.ruby-forum.com/t/link-to-remote-with-parameters-not-working-in-rails-3/187547)

<div class="topic-metadata">

**Author:** [@Wanderwelten](https://www.ruby-forum.com/u/Wanderwelten)\
**Replies:** 1\
**Last updated:** [May 10, 2010, 2:01pm UTC](https://www.ruby-forum.com/t/link-to-remote-with-parameters-not-working-in-rails-3/187547 "2010-05-10T14:01:35Z")

</div>

Hey community, since some day i dive into Rails and started with the basics for developing applications. Yesterday i spend a lot of time for how to create a remote’able link\_to with parameters. What orginally should …

---

## [How to get referral (inner) link](https://www.ruby-forum.com/t/how-to-get-referral-inner-link/188333)

<div class="topic-metadata">

**Author:** [@adedip](https://www.ruby-forum.com/u/adedip)\
**Replies:** 0\
**Last updated:** [May 10, 2010, 11:43am UTC](https://www.ruby-forum.com/t/how-to-get-referral-inner-link/188333 "2010-05-10T11:43:27Z")

</div>

Hi there, here’s my problem. I have the whole site pages that might point in anymoment to a map page where customer choose the country he belongs to. I need to save the url they where before to enter into the map page…

---

## [How to prevent query being executed for each row in list](https://www.ruby-forum.com/t/how-to-prevent-query-being-executed-for-each-row-in-list/188324)

<div class="topic-metadata">

**Author:** [@edwin](https://www.ruby-forum.com/u/edwin)\
**Replies:** 1\
**Last updated:** [May 10, 2010, 11:24am UTC](https://www.ruby-forum.com/t/how-to-prevent-query-being-executed-for-each-row-in-list/188324 "2010-05-10T11:24:43Z")

</div>

Hello, I have just started using rails and I am wondering how I can prevent a query being executed for each row in my list view. I have 2 models: OrganizationType and Organization which has a one-to- many relationshi…

---

## [Problem using FasterCSV on Import: Can't convert Tempfile to string](https://www.ruby-forum.com/t/problem-using-fastercsv-on-import-cant-convert-tempfile-to-string/188326)

<div class="topic-metadata">

**Author:** [@Kryptyk\_Fysh](https://www.ruby-forum.com/u/Kryptyk_Fysh)\
**Replies:** 0\
**Last updated:** [May 10, 2010, 10:56am UTC](https://www.ruby-forum.com/t/problem-using-fastercsv-on-import-cant-convert-tempfile-to-string/188326 "2010-05-10T10:56:01Z")

</div>

Hi, I’m trying to import a CSV file using fasterCSV and keep getting this error when trying to import the file. The parameters are passed from this view: \<% form\_for :dump, :url =\> { :controller =\> ‘mots’, :action =\> …

---

## [Missing templates problem in tests](https://www.ruby-forum.com/t/missing-templates-problem-in-tests/188319)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 0\
**Last updated:** [May 10, 2010, 9:51am UTC](https://www.ruby-forum.com/t/missing-templates-problem-in-tests/188319 "2010-05-10T09:51:27Z")

</div>

Hello champs, I have been writing a functional test in which i create a new record and finds out that the record is porperly created or not. So i do it like this:- def test\_should\_create\_record assert\_difference(‘A…

---

## [Type Error , can't dup NilCLASS](https://www.ruby-forum.com/t/type-error-cant-dup-nilclass/188321)

<div class="topic-metadata">

**Author:** [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Replies:** 0\
**Last updated:** [May 10, 2010, 9:22am UTC](https://www.ruby-forum.com/t/type-error-cant-dup-nilclass/188321 "2010-05-10T09:22:02Z")

</div>

HI, In myapplication i am sending mails using ruby actionmailer. I have 2 different actions 2 diff types of mails. fisrt one is working fine. when i tried to send mails from 2nd action i am getting the error. I attac…

---

## [Webrick Starts but Page never not loads the first time](https://www.ruby-forum.com/t/webrick-starts-but-page-never-not-loads-the-first-time/188246)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 2\
**Last updated:** [May 10, 2010, 6:59am UTC](https://www.ruby-forum.com/t/webrick-starts-but-page-never-not-loads-the-first-time/188246 "2010-05-10T06:59:33Z")

</div>

I’m able to start Webrick per the below results: $ ruby script/server =\> Booting WEBrick =\> Rails 2.3.5 application starting on http://0.0.0.0:3000 =\> Call with -d to detach =\> Ctrl-C to shutdown server \[2010-05-07…

---

## [Rails 3: Get the original filename from file uploads](https://www.ruby-forum.com/t/rails-3-get-the-original-filename-from-file-uploads/188312)

<div class="topic-metadata">

**Author:** [@builtbysimple](https://www.ruby-forum.com/u/builtbysimple)\
**Replies:** 0\
**Last updated:** [May 10, 2010, 4:58am UTC](https://www.ruby-forum.com/t/rails-3-get-the-original-filename-from-file-uploads/188312 "2010-05-10T04:58:22Z")

</div>

Hi all, I am currently using Rails 3 and I am using it to upload a file. How do I get the original filename using Rails 3? Because when I use File.basename(), what I get is RackFileUpload and not the original filenam…

---

## [Web2py and rails on Windows](https://www.ruby-forum.com/t/web2py-and-rails-on-windows/188308)

<div class="topic-metadata">

**Author:** [@mdipierro](https://www.ruby-forum.com/u/mdipierro)\
**Replies:** 1\
**Last updated:** [May 10, 2010, 3:15am UTC](https://www.ruby-forum.com/t/web2py-and-rails-on-windows/188308 "2010-05-10T03:15:22Z")

</div>

In relation to this discussion: http://groups.google.com/group/rubyonrails-talk/msg/654445a5da339885 I am not a windows user but I know many of you are. What is your impression on web2py on windows? Is there any issu…

---

## [New to web app development -- ROR pros and cons](https://www.ruby-forum.com/t/new-to-web-app-development-ror-pros-and-cons/188185)

<div class="topic-metadata">

**Author:** [@anthony](https://www.ruby-forum.com/u/anthony)\
**Replies:** 10\
**Last updated:** [May 10, 2010, 1:03am UTC](https://www.ruby-forum.com/t/new-to-web-app-development-ror-pros-and-cons/188185 "2010-05-10T01:03:06Z")

</div>

I am brand new to web application development, and I’m looking for a good web framework to learn in order to build a new web application (sort of a personal task/project management system). I’ve got some experience wi…

---

## [Rails,RSpec,Rcov,Lib](https://www.ruby-forum.com/t/rails-rspec-rcov-lib/188303)

<div class="topic-metadata">

**Author:** [@kampers](https://www.ruby-forum.com/u/kampers)\
**Replies:** 0\
**Last updated:** [May 10, 2010, 12:45am UTC](https://www.ruby-forum.com/t/rails-rspec-rcov-lib/188303 "2010-05-10T00:45:07Z")

</div>

Okay, I’ve probably just been staring at this for too long, but here is the problem I hope to get some help with: I’m creating a little lib directly inside rails for integrating with Plesk. I’m also creating two cust…

---

## [How to access variable in 3 level (model,controller,view)](https://www.ruby-forum.com/t/how-to-access-variable-in-3-level-model-controller-view/188294)

<div class="topic-metadata">

**Author:** [@Fuyi](https://www.ruby-forum.com/u/Fuyi)\
**Replies:** 2\
**Last updated:** [May 9, 2010, 9:20pm UTC](https://www.ruby-forum.com/t/how-to-access-variable-in-3-level-model-controller-view/188294 "2010-05-09T21:20:09Z")

</div>

how to access variable in 3 level (model,controller,view) i use session\[:current\_unit\] only can in C and V can’t access in M i mean is use a goloble variable can access in anywhere Such as: user slecet a Unit, in…

---

## [Saving a "found\_by\_sql" AR](https://www.ruby-forum.com/t/saving-a-found-by-sql-ar/188284)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 8\
**Last updated:** [May 9, 2010, 9:03pm UTC](https://www.ruby-forum.com/t/saving-a-found-by-sql-ar/188284 "2010-05-09T21:03:33Z")

</div>

If an active record is returned as a result of a find\_by\_sql() query, what must be true in order for it to be save-able? Here’s an example of it not working: require ‘rubygems’ require ‘active\_record’ ActiveRecord::…

---

## [Decorator pattern in Ruby... what do you think about the implementation?](https://www.ruby-forum.com/t/decorator-pattern-in-ruby-what-do-you-think-about-the-implementation/188278)

<div class="topic-metadata">

**Author:** [@samiron](https://www.ruby-forum.com/u/samiron)\
**Replies:** 4\
**Last updated:** [May 9, 2010, 8:56pm UTC](https://www.ruby-forum.com/t/decorator-pattern-in-ruby-what-do-you-think-about-the-implementation/188278 "2010-05-09T20:56:09Z")

</div>

Hello all I was wondering about how you guys are implementing the decorator patterns in Ruby? Here is a thought to share with. Tagged - The social network for meeting new people. Could you please share your thoughts …

---

## [\[JOBS\] Ruby Development Opportunities with ideeli.com](https://www.ruby-forum.com/t/jobs-ruby-development-opportunities-with-ideeli-com/188252)

<div class="topic-metadata">

**Author:** [@EthanSideeli](https://www.ruby-forum.com/u/EthanSideeli)\
**Replies:** 2\
**Last updated:** [May 9, 2010, 7:21pm UTC](https://www.ruby-forum.com/t/jobs-ruby-development-opportunities-with-ideeli-com/188252 "2010-05-09T19:21:54Z")

</div>

Hello Ruby Developers, I’m happy to announce that my company recently received $20 million in funding from our investors and is looking to expand our technology team. We’re an exciting, venture-funded community/commer…

---

## [Multiple has\_many through join table appears multiple times](https://www.ruby-forum.com/t/multiple-has-many-through-join-table-appears-multiple-times/188129)

<div class="topic-metadata">

**Author:** [@all4miller](https://www.ruby-forum.com/u/all4miller)\
**Replies:** 1\
**Last updated:** [May 9, 2010, 7:09pm UTC](https://www.ruby-forum.com/t/multiple-has-many-through-join-table-appears-multiple-times/188129 "2010-05-09T19:09:27Z")

</div>

Hi All, I am trying to configure my models to generate sql like this: select \* from location inner join sales inner join product inner join calendar Currently the models all have this: class Location… has\_many :…

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

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