# Rails

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

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

---

## [Regex to replace href links from static html](https://www.ruby-forum.com/t/regex-to-replace-href-links-from-static-html/186922)

<div class="topic-metadata">

**Author:** [@amalasingh](https://www.ruby-forum.com/u/amalasingh)\
**Replies:** 1\
**Last updated:** [April 14, 2010, 12:59pm UTC](https://www.ruby-forum.com/t/regex-to-replace-href-links-from-static-html/186922 "2010-04-14T12:59:19Z")

</div>

Hi, I am in the process of migrating some static html pages to ROR . See http://pm.tamil.net/akaram\_uni.html. Currently it is difficult to migrate because the href references point to different locations. Eg.http://…

---

## [Does drop\_table also remove\_index?](https://www.ruby-forum.com/t/does-drop-table-also-remove-index/186898)

<div class="topic-metadata">

**Author:** [@GoodGets](https://www.ruby-forum.com/u/GoodGets)\
**Replies:** 2\
**Last updated:** [April 14, 2010, 12:58pm UTC](https://www.ruby-forum.com/t/does-drop-table-also-remove-index/186898 "2010-04-14T12:58:09Z")

</div>

Well, the title pretty much says it all, but here it is again: will drop\_table also remove any indexes for that table? Or do we need to specify each index in the down migration? I tried looking through the drop\_tabl…

---

## [Params\[hash\] and link\_to.... easy question... but I am stupid :)](https://www.ruby-forum.com/t/params-hash-and-link-to-easy-question-but-i-am-stupid/186901)

<div class="topic-metadata">

**Author:** [@slindsey3000](https://www.ruby-forum.com/u/slindsey3000)\
**Replies:** 5\
**Last updated:** [April 14, 2010, 10:28am UTC](https://www.ruby-forum.com/t/params-hash-and-link-to-easy-question-but-i-am-stupid/186901 "2010-04-14T10:28:19Z")

</div>

routes.rb map.connect ‘:controller/:action/:id/:draw\_id’, :controller =\> “admin”, :action =\> “edit\_position” In a view I have: \<%= link\_to “#{@draw.positions\[0\].team}”, { :controller =\> :admin, :action =\> :edit\_posi…

---

## [Display USERNAME next to post](https://www.ruby-forum.com/t/display-username-next-to-post/186711)

<div class="topic-metadata">

**Author:** [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Replies:** 3\
**Last updated:** [April 14, 2010, 8:26am UTC](https://www.ruby-forum.com/t/display-username-next-to-post/186711 "2010-04-14T08:26:33Z")

</div>

Hello, I’m sure all of you have done this before, basically users can post new posts, but i want their names next to the post. I have a current\_user helper method, but i dont know how to display a static one next to…

---

## [JOBS - One time install easy over the web](https://www.ruby-forum.com/t/jobs-one-time-install-easy-over-the-web/186840)

<div class="topic-metadata">

**Author:** [@Developer\_Michael](https://www.ruby-forum.com/u/Developer_Michael)\
**Replies:** 2\
**Last updated:** [April 14, 2010, 6:24am UTC](https://www.ruby-forum.com/t/jobs-one-time-install-easy-over-the-web/186840 "2010-04-14T06:24:48Z")

</div>

I need someone to install a website for me. I have the source code, it is a open source project from spot.us. I want to evaluate the website for a startup but am not familiar with RoR so I want to pay someone to get …

---

## ["We're sorry, but something went wrong"](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong/186589)

<div class="topic-metadata">

**Author:** [@Kameron\_Hinton](https://www.ruby-forum.com/u/Kameron_Hinton)\
**Replies:** 3\
**Last updated:** [April 14, 2010, 6:21am UTC](https://www.ruby-forum.com/t/were-sorry-but-something-went-wrong/186589 "2010-04-14T06:21:52Z")

</div>

can anyone help with this??? /!\\ FAILSAFE /!\\ Thu Apr 08 16:58:27 -0700 2010 Status: 500 Internal Server Error unknown error C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in initialize' C:/Ruby/lib/ruby/1.8/dl/import.rb:29:i…

---

## [How to remove dependents in has-many-belongs-to relationship before saving?](https://www.ruby-forum.com/t/how-to-remove-dependents-in-has-many-belongs-to-relationship-before-saving/186892)

<div class="topic-metadata">

**Author:** [@grar](https://www.ruby-forum.com/u/grar)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 10:13pm UTC](https://www.ruby-forum.com/t/how-to-remove-dependents-in-has-many-belongs-to-relationship-before-saving/186892 "2010-04-13T22:13:04Z")

</div>

Hi, In my RESTful controller’s create method, how do I intercept and modify any dependents before saving? That is, I have a model that is the parent of nested associations gathered from a form. The first line of this…

---

## [Testing partials](https://www.ruby-forum.com/t/testing-partials/186842)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 4\
**Last updated:** [April 13, 2010, 9:59pm UTC](https://www.ruby-forum.com/t/testing-partials/186842 "2010-04-13T21:59:37Z")

</div>

Guys, How can we test partials and layouts… ? Googled but find nothing useful…

---

## [Non model array and html select tag](https://www.ruby-forum.com/t/non-model-array-and-html-select-tag/186878)

<div class="topic-metadata">

**Author:** [@kevid](https://www.ruby-forum.com/u/kevid)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 9:25pm UTC](https://www.ruby-forum.com/t/non-model-array-and-html-select-tag/186878 "2010-04-13T21:25:04Z")

</div>

hi all, I want to populate the options of a html tag with the elements of an array (not from a model) say; arr= \[‘has’, ‘have’, ‘give’, ‘get’\] i can’t figure out how i can achieve this. any suggesstion is appre…

---

## [How to copy a selected value into a text\_field](https://www.ruby-forum.com/t/how-to-copy-a-selected-value-into-a-text-field/186674)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 8\
**Last updated:** [April 13, 2010, 9:04pm UTC](https://www.ruby-forum.com/t/how-to-copy-a-selected-value-into-a-text-field/186674 "2010-04-13T21:04:35Z")

</div>

In app\\views\\expenses\\new.html.erb, I (mistakenly) replaced the script/generated: \<%= f.label :vendor %\> \<%= f.text\_field :vendor %\> with: \<%= f.label :vendor %\> \<% @current\_vendors = Vendor.find(:all, :order=\>“…

---

## [Each print \<br\> after a few iterations](https://www.ruby-forum.com/t/each-print-br-after-a-few-iterations/186886)

<div class="topic-metadata">

**Author:** [@joris](https://www.ruby-forum.com/u/joris)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 8:56pm UTC](https://www.ruby-forum.com/t/each-print-br-after-a-few-iterations/186886 "2010-04-13T20:56:58Z")

</div>

I want to generate a table of images, something like: So I’ve to put a after 3 iterations, how should I do this? I could make a counter initialize it on zero, increment its value and check it for “mod3=0”, b…

---

## [Named scopes, chaining and instance methods](https://www.ruby-forum.com/t/named-scopes-chaining-and-instance-methods/186872)

<div class="topic-metadata">

**Author:** [@ian](https://www.ruby-forum.com/u/ian)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 7:30pm UTC](https://www.ruby-forum.com/t/named-scopes-chaining-and-instance-methods/186872 "2010-04-13T19:30:21Z")

</div>

In my app we have lists of people that we allow users to filter a variety of ways. For example, a user might choose 3 filters: Enrolled, Living and Lives in Wyoming. To handle this, I’ve been using named scopes. The P…

---

## [I18n\_routing: Easy routes translations for Rails 2.x And Rails3](https://www.ruby-forum.com/t/i18n-routing-easy-routes-translations-for-rails-2-x-and-rails3/186454)

<div class="topic-metadata">

**Author:** [@kwi](https://www.ruby-forum.com/u/kwi)\
**Replies:** 7\
**Last updated:** [April 13, 2010, 6:37pm UTC](https://www.ruby-forum.com/t/i18n-routing-easy-routes-translations-for-rails-2-x-and-rails3/186454 "2010-04-13T18:37:38Z")

</div>

Hi everyone, Last week, I have finaly pushed my plugin that do Rails routing translation on github. It’s based on top of I18n api and it works with Rails 2 and Rails 3 ! I currently use it in production on several Ra…

---

## [Character encoding](https://www.ruby-forum.com/t/character-encoding/186879)

<div class="topic-metadata">

**Author:** [@ESESES](https://www.ruby-forum.com/u/ESESES)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 6:22pm UTC](https://www.ruby-forum.com/t/character-encoding/186879 "2010-04-13T18:22:24Z")

</div>

I’m getting this for my templates, how can I change the encoding? incompatible character encodings: UTF-8 and ASCII-8BIT

---

## [Scientific articles about Ruby on Rails](https://www.ruby-forum.com/t/scientific-articles-about-ruby-on-rails/186876)

<div class="topic-metadata">

**Author:** [@andrew](https://www.ruby-forum.com/u/andrew)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 6:13pm UTC](https://www.ruby-forum.com/t/scientific-articles-about-ruby-on-rails/186876 "2010-04-13T18:13:49Z")

</div>

Hi all! I’m writing bachelor work, about Ruby On Rails. I’am searching for links, to conference publications, scientific articles about Ruby on Rails. If you know such kind of resources, leave links here. Thanks a lo…

---

## [Using an array object in a form helper](https://www.ruby-forum.com/t/using-an-array-object-in-a-form-helper/186870)

<div class="topic-metadata">

**Author:** [@ESESES](https://www.ruby-forum.com/u/ESESES)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/using-an-array-object-in-a-form-helper/186870 "2010-04-13T17:56:37Z")

</div>

I have an array of the attributes of an object that I would like to use to generate a form. For example, I’d like to say \<% fields\_for :questions do |f|%\> \<% for c in @attributes %\> \<%= f.text\_field \[c…

---

## [Need clarification on mongrel, rails, threads, and performance](https://www.ruby-forum.com/t/need-clarification-on-mongrel-rails-threads-and-performance/186860)

<div class="topic-metadata">

**Author:** [@skarayan](https://www.ruby-forum.com/u/skarayan)\
**Replies:** 3\
**Last updated:** [April 13, 2010, 5:17pm UTC](https://www.ruby-forum.com/t/need-clarification-on-mongrel-rails-threads-and-performance/186860 "2010-04-13T17:17:57Z")

</div>

My understanding is that: rails is single threaded and serves one request at a time mongrel is single threaded and can process one rails request at a time mongrel\_cluster starts a few mongrel servers on the same machi…

---

## [Associated join data save problem](https://www.ruby-forum.com/t/associated-join-data-save-problem/186849)

<div class="topic-metadata">

**Author:** [@rahul\_m](https://www.ruby-forum.com/u/rahul_m)\
**Replies:** 5\
**Last updated:** [April 13, 2010, 1:29pm UTC](https://www.ruby-forum.com/t/associated-join-data-save-problem/186849 "2010-04-13T13:29:36Z")

</div>

Hiiii, I have created one migration… class TagContentMasterJoin \< ActiveRecord::Migration def self.up create\_table ‘content\_masters\_tags’ do |t| t.column ‘tag\_id’, :integer t.column ‘content\_master\_id’, :integer t…

---

## [Rails3, rvm, ruby1.9.2: "bundle install" suddenly installs into Rails.root?](https://www.ruby-forum.com/t/rails3-rvm-ruby1-9-2-bundle-install-suddenly-installs-into-rails-root/186850)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 11:43am UTC](https://www.ruby-forum.com/t/rails3-rvm-ruby1-9-2-bundle-install-suddenly-installs-into-rails-root/186850 "2010-04-13T11:43:05Z")

</div>

Hi, Does anyone know what could have caused bundler to try to install gems not into the ~/.rvm directory? I did not change anything compared to yesterday where I did the same thing. Yes, I updated bundler today and a…

---

## [Persist the same url even if validation fails](https://www.ruby-forum.com/t/persist-the-same-url-even-if-validation-fails/186847)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 10:40am UTC](https://www.ruby-forum.com/t/persist-the-same-url-even-if-validation-fails/186847 "2010-04-13T10:40:24Z")

</div>

Hi I have routes defined like map.resources :staff, :member =\> {:registration\_completion =\> :put} map.staff\_registration ‘/staff\_registration/:code’, :controller =\> ‘staff’, :action =\> ‘registration’ And I have cont…

---

## [Help needed: upgrading from Rails 2.0.2 to Rails 2.3.5](https://www.ruby-forum.com/t/help-needed-upgrading-from-rails-2-0-2-to-rails-2-3-5/186843)

<div class="topic-metadata">

**Author:** [@Arunmohan](https://www.ruby-forum.com/u/Arunmohan)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 10:04am UTC](https://www.ruby-forum.com/t/help-needed-upgrading-from-rails-2-0-2-to-rails-2-3-5/186843 "2010-04-13T10:04:44Z")

</div>

Hi, I am trying to upgrade my existing application from Rails 2.0.2 to 2.3.5. I am getting the following error while I run the test: ruby test/unit/address\_test.rb --name test\_address2\_required\_in\_jp Loaded suite tes…

---

## [Named\_scope when using foreign keys](https://www.ruby-forum.com/t/named-scope-when-using-foreign-keys/186214)

<div class="topic-metadata">

**Author:** [@jeb](https://www.ruby-forum.com/u/jeb)\
**Replies:** 7\
**Last updated:** [April 13, 2010, 10:04am UTC](https://www.ruby-forum.com/t/named-scope-when-using-foreign-keys/186214 "2010-04-13T10:04:44Z")

</div>

Hi all, I can’t get this named scope to work. Each store has a number of users. Each store can have one manager. I ant to use a nemed scope to find the manager by name. Have I got this totally backwards? Help appreci…

---

## [JOBS - Looking for ROR Developers - Urgently Neeeded in Toronto](https://www.ruby-forum.com/t/jobs-looking-for-ror-developers-urgently-neeeded-in-toronto/186841)

<div class="topic-metadata">

**Author:** [@Jason\_Vaz](https://www.ruby-forum.com/u/Jason_Vaz)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 10:04am UTC](https://www.ruby-forum.com/t/jobs-looking-for-ror-developers-urgently-neeeded-in-toronto/186841 "2010-04-13T10:04:09Z")

</div>

Position: Web D. (Full-time) Department: Web Reports To: Manager, Software Development Application Due Date: ASAP Start Date: ASAP Responsibilities: •Designing and developing data-driven applications including mark…

---

## [Customized Route Resource Helper URLs (to not use 'id')](https://www.ruby-forum.com/t/customized-route-resource-helper-urls-to-not-use-id/186724)

<div class="topic-metadata">

**Author:** [@sethwillits](https://www.ruby-forum.com/u/sethwillits)\
**Replies:** 5\
**Last updated:** [April 13, 2010, 8:42am UTC](https://www.ruby-forum.com/t/customized-route-resource-helper-urls-to-not-use-id/186724 "2010-04-13T08:42:47Z")

</div>

Say I have a “Member” ActiveRecord object with a typical integer id attribute, and a string ‘username’ attribute. If I generate routes for members using map.resources :members, then the output from the edit helper is: …

---

## [Tracking User Behaviour](https://www.ruby-forum.com/t/tracking-user-behaviour/186833)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 1\
**Last updated:** [April 13, 2010, 8:36am UTC](https://www.ruby-forum.com/t/tracking-user-behaviour/186833 "2010-04-13T08:36:20Z")

</div>

Are there any good log analyzers that help you see user behavior, like tracking user clicks, and not just analyze for performance?

---

## [NESTED routes?](https://www.ruby-forum.com/t/nested-routes/186827)

<div class="topic-metadata">

**Author:** [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Replies:** 2\
**Last updated:** [April 13, 2010, 8:33am UTC](https://www.ruby-forum.com/t/nested-routes/186827 "2010-04-13T08:33:24Z")

</div>

Hey everyone, What if i need to do this in my routes.rb– a has many b, b has many c, and c has many d How on earth do i define the nested routes like that? Thanks

---

## [How to check if a parent has children?](https://www.ruby-forum.com/t/how-to-check-if-a-parent-has-children/186831)

<div class="topic-metadata">

**Author:** [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Replies:** 5\
**Last updated:** [April 13, 2010, 6:03am UTC](https://www.ruby-forum.com/t/how-to-check-if-a-parent-has-children/186831 "2010-04-13T06:03:34Z")

</div>

What is the new way to check if a parent has child items? In rails 1.2.6 I did this: if @client.has\_line\_items? Client being the parent and line\_items the children. Now that I have upgraded to rails 2.0.1 (on my way …

---

## [Nested forms: Can you access the object from within fields\_for?](https://www.ruby-forum.com/t/nested-forms-can-you-access-the-object-from-within-fields-for/186716)

<div class="topic-metadata">

**Author:** [@John\_Grimes](https://www.ruby-forum.com/u/John_Grimes)\
**Replies:** 2\
**Last updated:** [April 13, 2010, 5:50am UTC](https://www.ruby-forum.com/t/nested-forms-can-you-access-the-object-from-within-fields-for/186716 "2010-04-13T05:50:41Z")

</div>

Hi all, Say I had the following form: \<% form\_for @user do |f| %\> \<%= f.error\_messages %\> \<% f.fields\_for :friends do |friends| %\> \<%= friends.text\_field :relationship\_to\_you %\> \<% end %\> \<%= f.submit "Submit" %\>…

---

## [Clearing a plugins instance variables on each request](https://www.ruby-forum.com/t/clearing-a-plugins-instance-variables-on-each-request/186717)

<div class="topic-metadata">

**Author:** [@SeanWalberg](https://www.ruby-forum.com/u/SeanWalberg)\
**Replies:** 3\
**Last updated:** [April 13, 2010, 4:48am UTC](https://www.ruby-forum.com/t/clearing-a-plugins-instance-variables-on-each-request/186717 "2010-04-13T04:48:40Z")

</div>

I’m trying to move some of my application’s code into a plugin, specifically the part that deals with web analytics. Some of the features allow the controller to fire events that get displayed in the views as JS code …

---

## [Need to turn off caching of associative table: statuses getting scrambled](https://www.ruby-forum.com/t/need-to-turn-off-caching-of-associative-table-statuses-getting-scrambled/186832)

<div class="topic-metadata">

**Author:** [@patrick\_nicholas](https://www.ruby-forum.com/u/patrick_nicholas)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 3:56am UTC](https://www.ruby-forum.com/t/need-to-turn-off-caching-of-associative-table-statuses-getting-scrambled/186832 "2010-04-13T03:56:35Z")

</div>

Am in development mode. I have an associative table (scripts\_runs) (has\_many, through) that carries a status column (‘started’, ‘ready to parse’, ‘completed’ ). The started and ready to parse states are signaled by ‘f…

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

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