# Rails

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

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

---

## [How to use restful\_authentication for nested resources in Ra](https://www.ruby-forum.com/t/how-to-use-restful-authentication-for-nested-resources-in-ra/193478)

<div class="topic-metadata">

**Author:** [@luckydev](https://www.ruby-forum.com/u/luckydev)\
**Replies:** 3\
**Last updated:** [August 18, 2010, 5:16pm UTC](https://www.ruby-forum.com/t/how-to-use-restful-authentication-for-nested-resources-in-ra/193478 "2010-08-18T17:16:22Z")

</div>

I have a nested resource hotel\_user and i wish to have hotel\_users\_controller under hotel namespace. I want to use restful authentication here and I want hotel\_users\_controller, sessions\_controller in hotel directory …

---

## [Upgarde from rails 2.3.5 to rails 2.3.8](https://www.ruby-forum.com/t/upgarde-from-rails-2-3-5-to-rails-2-3-8/193474)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 1\
**Last updated:** [August 18, 2010, 3:35pm UTC](https://www.ruby-forum.com/t/upgarde-from-rails-2-3-5-to-rails-2-3-8/193474 "2010-08-18T15:35:02Z")

</div>

Hi I upgraded my rails application rails 2.3.8 from 2.3.5 like below gem install rails -v=2.3.8 Now in environemnt.rb RAILS\_GEM\_VERSION changed to '2.3.8'. Now when I tried to a previous migration like rake db:mi…

---

## [Auth logic - password confirmation](https://www.ruby-forum.com/t/auth-logic-password-confirmation/193462)

<div class="topic-metadata">

**Author:** [@oliver\_torres](https://www.ruby-forum.com/u/oliver_torres)\
**Replies:** 2\
**Last updated:** [August 18, 2010, 3:28pm UTC](https://www.ruby-forum.com/t/auth-logic-password-confirmation/193462 "2010-08-18T15:28:35Z")

</div>

Hi, newbie here. :slight\_smile: i have this form on a test rails app: \<% form\_for @user do |f| %\> \<%= f.error\_messages %\> \<%= f.label :username %\> \<%= f.text\_field :username %\> \<%= f.label :ema…

---

## [Undefined method \`eq' for nil:NilClass](https://www.ruby-forum.com/t/undefined-method-eq-for-nil-nilclass/193479)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 5\
**Last updated:** [August 18, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/undefined-method-eq-for-nil-nilclass/193479 "2010-08-18T15:08:50Z")

</div>

I’m walking through an example in the “Head First Rails” book, but, instead doing the examples using Rails3.0.0.rc. But, I’m getting this error when browsing for example: http://localhost:3000/advs/1 undefined method…

---

## [\[rails 3\] how to write an Ajax call w the new unobtrusive js?](https://www.ruby-forum.com/t/rails-3-how-to-write-an-ajax-call-w-the-new-unobtrusive-js/193436)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 3\
**Last updated:** [August 18, 2010, 1:01pm UTC](https://www.ruby-forum.com/t/rails-3-how-to-write-an-ajax-call-w-the-new-unobtrusive-js/193436 "2010-08-18T13:01:39Z")

</div>

I have current a js function call I would like to transform into an Ajax request = check\_box\_tag “selection”, “1”, false, {:id =\> user.id, :onclick =\> “showHideMenuItem(this);”} I found a lot of examples on link\_to ,…

---

## [Delete link in Rails 3](https://www.ruby-forum.com/t/delete-link-in-rails-3/193459)

<div class="topic-metadata">

**Author:** [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Replies:** 3\
**Last updated:** [August 18, 2010, 12:54pm UTC](https://www.ruby-forum.com/t/delete-link-in-rails-3/193459 "2010-08-18T12:54:36Z")

</div>

Closing in steadily on my Rails 3 upgrade. I can see the finish line. A few more wrinkles to iron out. My Rails app uses jQuery and Haml. I downloaded the rails.js and put it in my application.html.haml as I show be…

---

## [\[prototype\] Element.readAttribute in js.rjs](https://www.ruby-forum.com/t/prototype-element-readattribute-in-js-rjs/193473)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [August 18, 2010, 11:58am UTC](https://www.ruby-forum.com/t/prototype-element-readattribute-in-js-rjs/193473 "2010-08-18T11:58:25Z")

</div>

I am trying to test the ‘type’ attribute’ of some elements in my page , but I don’t get it right, writing the following code in my .rj.rjs file page.select(’#user-list input’).each do |e| t = e.readAttribute(‘type’) …

---

## [/config/database.yml accessable in beta/alpha](https://www.ruby-forum.com/t/config-database-yml-accessable-in-beta-alpha/184535)

<div class="topic-metadata">

**Author:** [@toddf](https://www.ruby-forum.com/u/toddf)\
**Replies:** 2\
**Last updated:** [August 18, 2010, 11:01am UTC](https://www.ruby-forum.com/t/config-database-yml-accessable-in-beta-alpha/184535 "2010-08-18T11:01:53Z")

</div>

we’re not sure how to stop this, but on a few of our projects the database.yml is accessble and on others it’s not (only in an alpha/beta environment, production is OK). regardless we still need to stop it from being …

---

## [\[Rails 3\] remote\_function?](https://www.ruby-forum.com/t/rails-3-remote-function/193460)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 2\
**Last updated:** [August 18, 2010, 10:47am UTC](https://www.ruby-forum.com/t/rails-3-remote-function/193460 "2010-08-18T10:47:34Z")

</div>

Is the remote\_function still valid in Rails 3 as it seems many of the Prototype helpers have been replaced ? (link\_to\_remote, …) where can I find any link on it ? not in the standard doc I guess … thanks for you fe…

---

## [Make a language selector for I18n UI](https://www.ruby-forum.com/t/make-a-language-selector-for-i18n-ui/193366)

<div class="topic-metadata">

**Author:** [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Replies:** 7\
**Last updated:** [August 18, 2010, 9:39am UTC](https://www.ruby-forum.com/t/make-a-language-selector-for-i18n-ui/193366 "2010-08-18T09:39:39Z")

</div>

Hello everyone, happy holidays if you are enjoying it right now. I would like to make a simple language selector like this: SELECTOR (current locale \[:es\]) Select Language: EspaÃ±ol | Catala | French Anyway, I’d lik…

---

## [Paper clip plugin validation fails](https://www.ruby-forum.com/t/paper-clip-plugin-validation-fails/193465)

<div class="topic-metadata">

**Author:** [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Replies:** 0\
**Last updated:** [August 18, 2010, 7:49am UTC](https://www.ruby-forum.com/t/paper-clip-plugin-validation-fails/193465 "2010-08-18T07:49:21Z")

</div>

hallo friends i developpeda photo uploader using paper clip plugin its working quite well , but one problem is its able to upload all kinds of file. see i want only png,gif,jpeg and should show error messag…

---

## [First Test Failures: Anything Obvious?](https://www.ruby-forum.com/t/first-test-failures-anything-obvious/193403)

<div class="topic-metadata">

**Author:** [@callyworld](https://www.ruby-forum.com/u/callyworld)\
**Replies:** 6\
**Last updated:** [August 18, 2010, 7:42am UTC](https://www.ruby-forum.com/t/first-test-failures-anything-obvious/193403 "2010-08-18T07:42:37Z")

</div>

Still following my rails book (more like, adapting to my project as I go). My first attempt at a unit test failed. Adapting the example in the book, I came up with this: require ‘test\_helper’ class RecordingTest \< Ac…

---

## [Extending ActiveRecords in Rails 3](https://www.ruby-forum.com/t/extending-activerecords-in-rails-3/193446)

<div class="topic-metadata">

**Author:** [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Replies:** 1\
**Last updated:** [August 18, 2010, 2:48am UTC](https://www.ruby-forum.com/t/extending-activerecords-in-rails-3/193446 "2010-08-18T02:48:16Z")

</div>

I have added a method to the ActiveRecords module and put it in the lib directory like so: module ActiveRecord class Base def self.my\_search(search, current\_page, search\_field, user\_role, perms) … end end end T…

---

## [Arel: Mathematical arithmic on columns](https://www.ruby-forum.com/t/arel-mathematical-arithmic-on-columns/193456)

<div class="topic-metadata">

**Author:** [@Dykam](https://www.ruby-forum.com/u/Dykam)\
**Replies:** 0\
**Last updated:** [August 18, 2010, 1:57am UTC](https://www.ruby-forum.com/t/arel-mathematical-arithmic-on-columns/193456 "2010-08-18T01:57:51Z")

</div>

It’s hard to explain, so I’ll just write down what I have currently: table.project("sum(\`#{table.name}\`.\`#{table\[:column\_1\].name}\` \* #{table.name}.#{table\[:column\_2\].name})") I like to sanitize this and leave out as m…

---

## [Activerecord re-sets class members to null?](https://www.ruby-forum.com/t/activerecord-re-sets-class-members-to-null/193362)

<div class="topic-metadata">

**Author:** [@techy\_bolek](https://www.ruby-forum.com/u/techy_bolek)\
**Replies:** 6\
**Last updated:** [August 18, 2010, 1:33am UTC](https://www.ruby-forum.com/t/activerecord-re-sets-class-members-to-null/193362 "2010-08-18T01:33:53Z")

</div>

I have two classes with class variables. One of them derives from active record, the other one does not. I initialize both members to NULL, then lazy-instantiate them. The class which does not derive from active recor…

---

## [Building Gems](https://www.ruby-forum.com/t/building-gems/193394)

<div class="topic-metadata">

**Author:** [@dang](https://www.ruby-forum.com/u/dang)\
**Replies:** 3\
**Last updated:** [August 17, 2010, 7:39pm UTC](https://www.ruby-forum.com/t/building-gems/193394 "2010-08-17T19:39:34Z")

</div>

Hello all, I have been searching for a good tutorial of how to build a gem in Rails 3. I have found someones, but has not that good explained. I haven’t build either a gem or plugin even in Rails 2.3.\*, and I don’t …

---

## [Getting started: quick question virtual rails\>\>\>](https://www.ruby-forum.com/t/getting-started-quick-question-virtual-rails/193398)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [August 17, 2010, 7:37pm UTC](https://www.ruby-forum.com/t/getting-started-quick-question-virtual-rails/193398 "2010-08-17T19:37:35Z")

</div>

I am running Linux Mint with virtual machine and virtual rails installed on my laptop…I am barely learning ruby on rails and still a novice…now that I have virtual rails installed I am assuming I use the netbeans IDE …

---

## [How to development Database for testing](https://www.ruby-forum.com/t/how-to-development-database-for-testing/193405)

<div class="topic-metadata">

**Author:** [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Replies:** 8\
**Last updated:** [August 17, 2010, 6:45pm UTC](https://www.ruby-forum.com/t/how-to-development-database-for-testing/193405 "2010-08-17T18:45:04Z")

</div>

Hi, i want to use development database for my testing purpose. The problem is with, when test cases are run, it deletes the data before and after the test. but i dont want the data to be deleted. how to do this.

---

## [Installing selenium-on-rails - error on rake test](https://www.ruby-forum.com/t/installing-selenium-on-rails-error-on-rake-test/193435)

<div class="topic-metadata">

**Author:** [@ntk](https://www.ruby-forum.com/u/ntk)\
**Replies:** 0\
**Last updated:** [August 17, 2010, 5:43pm UTC](https://www.ruby-forum.com/t/installing-selenium-on-rails-error-on-rake-test/193435 "2010-08-17T17:43:01Z")

</div>

I’m following the instructions on installing Selenium on rails: “Run the Rakefile in the plugin???s directory to run the tests in order to see that everything works” When I rake: DKMac:selenium-on-rails DK$ rake tes…

---

## [Using \<a href\> in a text field](https://www.ruby-forum.com/t/using-a-href-in-a-text-field/193434)

<div class="topic-metadata">

**Author:** [@kaspir](https://www.ruby-forum.com/u/kaspir)\
**Replies:** 4\
**Last updated:** [August 17, 2010, 5:32pm UTC](https://www.ruby-forum.com/t/using-a-href-in-a-text-field/193434 "2010-08-17T17:32:49Z")

</div>

If this is a really stupid noob question I apologize in advance, and appreciate any answers I get from this. I made a blog with rails, and just finished with the design. Upon creating my first real post, I realized I …

---

## [Rake and Unitizialized Constants when RAIL\_ENV is specified](https://www.ruby-forum.com/t/rake-and-unitizialized-constants-when-rail-env-is-specified/193431)

<div class="topic-metadata">

**Author:** [@leo72](https://www.ruby-forum.com/u/leo72)\
**Replies:** 0\
**Last updated:** [August 17, 2010, 4:53pm UTC](https://www.ruby-forum.com/t/rake-and-unitizialized-constants-when-rail-env-is-specified/193431 "2010-08-17T16:53:48Z")

</div>

Hi guys, I’m having a problem with rake and rails 2.3.5 When I use any model inside db/seeds.rb or in any rake task and the RAILS\_ENV var is specified, I get the error: uninitialized constant ModelName Any clues? T…

---

## [Compass dosent work for me](https://www.ruby-forum.com/t/compass-dosent-work-for-me/193265)

<div class="topic-metadata">

**Author:** [@nirosh](https://www.ruby-forum.com/u/nirosh)\
**Replies:** 8\
**Last updated:** [August 17, 2010, 4:53pm UTC](https://www.ruby-forum.com/t/compass-dosent-work-for-me/193265 "2010-08-17T16:53:13Z")

</div>

hi all. i have install compass(followed instructions on compass home page) but when i run the compass command my terminal returns the “compass: command not found” error. my os is ubuntu, rails version 2.3.5, ruby 1…

---

## [Executing js.erb file with :format =\>'js'](https://www.ruby-forum.com/t/executing-js-erb-file-with-format-js/193380)

<div class="topic-metadata">

**Author:** [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Replies:** 8\
**Last updated:** [August 17, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/executing-js-erb-file-with-format-js/193380 "2010-08-17T16:27:39Z")

</div>

Hi, I’m trying to get my javascript to execute after clicking a link on my page using :format =\> “js” here’s my link: \<%= link\_to image\_tag("/images/icons/user\_add.png"), add\_contact\_path(:profile\_id =\> profile.id, :u…

---

## [Polymorphic Assosiations](https://www.ruby-forum.com/t/polymorphic-assosiations/193421)

<div class="topic-metadata">

**Author:** [@the-lar](https://www.ruby-forum.com/u/the-lar)\
**Replies:** 2\
**Last updated:** [August 17, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/polymorphic-assosiations/193421 "2010-08-17T16:26:03Z")

</div>

I have doubts on Polymorphic Assosiations. On Which situations we are using these?? What are the advantages?

---

## [Routes.rb](https://www.ruby-forum.com/t/routes-rb/193415)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 7\
**Last updated:** [August 17, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/routes-rb/193415 "2010-08-17T16:23:15Z")

</div>

Hello All, In routes.rb, to create and access a new page everytime i need to write :page\_name =\> :any to my config/routes.rb. Can you guys tell me any better alternative to this? Thanks in advance.

---

## [Devise & manual password change](https://www.ruby-forum.com/t/devise-manual-password-change/193429)

<div class="topic-metadata">

**Author:** [@itkin](https://www.ruby-forum.com/u/itkin)\
**Replies:** 0\
**Last updated:** [August 17, 2010, 4:11pm UTC](https://www.ruby-forum.com/t/devise-manual-password-change/193429 "2010-08-17T16:11:39Z")

</div>

Hello, i’m trying to use devise gem 1.1.1 on a new rails 3 app, I would like to change the password of my users from the console, user.password= works well in dev, but in production, despite the encrypted password ha…

---

## [I get Error after creating product](https://www.ruby-forum.com/t/i-get-error-after-creating-product/193408)

<div class="topic-metadata">

**Author:** [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Replies:** 7\
**Last updated:** [August 17, 2010, 3:32pm UTC](https://www.ruby-forum.com/t/i-get-error-after-creating-product/193408 "2010-08-17T15:32:06Z")

</div>

I get the following error inside my browser: ActiveRecord::RecordNotFound in ProductsController#show Couldn’t find Product without an ID RAILS\_ROOT: /Users/musdev/work/depot Application Trace | Framework Trace | Full…

---

## [Help with a few modifications to the Blog in 15 Minutes screencast](https://www.ruby-forum.com/t/help-with-a-few-modifications-to-the-blog-in-15-minutes-screencast/193420)

<div class="topic-metadata">

**Author:** [@kaspir](https://www.ruby-forum.com/u/kaspir)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/help-with-a-few-modifications-to-the-blog-in-15-minutes-screencast/193420 "2010-08-17T15:08:57Z")

</div>

Hi, I’m fairly new to rails, and I recently followed the screencast on the rails site to make a blog. Everything is working quite well, and I’m understanding the majority of it, but there’s two things I want to do, th…

---

## [Multiple model search with acts\_as\_solr\_reloaded](https://www.ruby-forum.com/t/multiple-model-search-with-acts-as-solr-reloaded/193422)

<div class="topic-metadata">

**Author:** [@jmanivannancse](https://www.ruby-forum.com/u/jmanivannancse)\
**Replies:** 0\
**Last updated:** [August 17, 2010, 2:39pm UTC](https://www.ruby-forum.com/t/multiple-model-search-with-acts-as-solr-reloaded/193422 "2010-08-17T14:39:53Z")

</div>

I have used act\_as\_solr\_reloaded plugin for searching option in my project I have two models which are brand and sku and its association are class Brand \< ActiveRecord::Base acts\_as\_solr :include =\> \[:skus\],:fields =\>…

---

## [\[Form\] Method POST & PUT problem](https://www.ruby-forum.com/t/form-method-post-put-problem/193399)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 2\
**Last updated:** [August 17, 2010, 2:14pm UTC](https://www.ruby-forum.com/t/form-method-post-put-problem/193399 "2010-08-17T14:14:56Z")

</div>

Hello, I have a form that should be a POST method, but Rails insist to put a hidden field “\_method” that has the value “put” does anyone knows why? Thanks, David S. Controller: ------------------------------- def n…

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

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