# Rails

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

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

---

## [How would you handle this?](https://www.ruby-forum.com/t/how-would-you-handle-this/152151)

<div class="topic-metadata">

**Author:** [@ressister](https://www.ruby-forum.com/u/ressister)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/how-would-you-handle-this/152151 "2008-10-30T16:32:26Z")

</div>

Hi there, I currently have two unique sites each requiring a news section which I planned to content manage through blog software. I installed Mephisto on the the same server as the two apps, and had it running succ…

---

## [Map.root doesn't work](https://www.ruby-forum.com/t/map-root-doesnt-work/152140)

<div class="topic-metadata">

**Author:** [@thithi32](https://www.ruby-forum.com/u/thithi32)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/map-root-doesnt-work/152140 "2008-10-30T16:19:49Z")

</div>

Hello, I’ve been trying to set map.root for my site and it doesn’t seem to work!! Here’s what I have in my routes.rb: " ActionController::Routing::Routes.draw do |map| map.root :controller =\> ‘leagues’, :action =\> …

---

## [Testing a production environment](https://www.ruby-forum.com/t/testing-a-production-environment/152148)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/testing-a-production-environment/152148 "2008-10-30T15:41:40Z")

</div>

In one place in my views I do something different if I’m in production rather than development or test. How do I test that? I need to change the environment for just that one test but I can’t set RAILS\_ENV as that’s a…

---

## [Setting session to nil when window is closed](https://www.ruby-forum.com/t/setting-session-to-nil-when-window-is-closed/152075)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 6\
**Last updated:** [October 30, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/setting-session-to-nil-when-window-is-closed/152075 "2008-10-30T15:26:24Z")

</div>

I have this app at work that has Administrators and Users as two types of users. I know who is a of what type by setting session variables: session\[:admin\] and session\[:user\] holding the id’s. The administrators can g…

---

## [Dynamic secured proxy](https://www.ruby-forum.com/t/dynamic-secured-proxy/152145)

<div class="topic-metadata">

**Author:** [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 3:01pm UTC](https://www.ruby-forum.com/t/dynamic-secured-proxy/152145 "2008-10-30T15:01:32Z")

</div>

I need a method of allowing an authenticated user to establish a proxied web session to a device via my rails app. The user will not be able to directly connect to the device due to subnets/firewalls, so all requests …

---

## [Convention for multiple id reference](https://www.ruby-forum.com/t/convention-for-multiple-id-reference/152138)

<div class="topic-metadata">

**Author:** [@vanight](https://www.ruby-forum.com/u/vanight)\
**Replies:** 2\
**Last updated:** [October 30, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/convention-for-multiple-id-reference/152138 "2008-10-30T14:27:38Z")

</div>

Hi, Here’s the thing : I have a table with languages (name, label, id). languages id name label I’d like another table people with primary\_language and secondary\_langage that should refer to a language\_id. peop…

---

## [Long running query causes Mongrel/Rails to block completely?](https://www.ruby-forum.com/t/long-running-query-causes-mongrel-rails-to-block-completely/152057)

<div class="topic-metadata">

**Author:** [@michael\_teter](https://www.ruby-forum.com/u/michael_teter)\
**Replies:** 10\
**Last updated:** [October 30, 2008, 1:51pm UTC](https://www.ruby-forum.com/t/long-running-query-causes-mongrel-rails-to-block-completely/152057 "2008-10-30T13:51:49Z")

</div>

Hi. I’m troubleshooting a problem, and I would love some help understanding what is going on. The problem is that Mongrel/Rails appears to hang or completely block if one of the users initiates a very slow, long-runn…

---

## [REST in rails 1.2.5](https://www.ruby-forum.com/t/rest-in-rails-1-2-5/152135)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 1:36pm UTC](https://www.ruby-forum.com/t/rest-in-rails-1-2-5/152135 "2008-10-30T13:36:47Z")

</div>

Hi I am using rails 1.2.5 And as part of learning rails I just create a model Person and migrated it (I am following the REST for rails 2 tutorial from peepcode) Then did ./script/generate scaffold Person Now inside…

---

## [Read last entry from data base](https://www.ruby-forum.com/t/read-last-entry-from-data-base/152132)

<div class="topic-metadata">

**Author:** [@xxmithila](https://www.ruby-forum.com/u/xxmithila)\
**Replies:** 6\
**Last updated:** [October 30, 2008, 1:30pm UTC](https://www.ruby-forum.com/t/read-last-entry-from-data-base/152132 "2008-10-30T13:30:06Z")

</div>

Hi… I want to read ID of last entered data set from table, are there any possible ways to it? help Im stucked… thankx

---

## [Get the id of the last record from a table](https://www.ruby-forum.com/t/get-the-id-of-the-last-record-from-a-table/152134)

<div class="topic-metadata">

**Author:** [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Replies:** 4\
**Last updated:** [October 30, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/get-the-id-of-the-last-record-from-a-table/152134 "2008-10-30T13:28:55Z")

</div>

can anyone tell me how can i get the last id(primary key) of the table

---

## [Mysql gem issue](https://www.ruby-forum.com/t/mysql-gem-issue/152127)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 9\
**Last updated:** [October 30, 2008, 1:25pm UTC](https://www.ruby-forum.com/t/mysql-gem-issue/152127 "2008-10-30T13:25:22Z")

</div>

(running OS X 10.5.5, MySQL 5, Rails 2.1, Ruby 1.8.7) I do not understand why after running : sudo gem update --system Updating RubyGems Nothing to update sudo gem install rubygems-update Successfully installed r…

---

## [How would you model this? Thanks for any suggestions!](https://www.ruby-forum.com/t/how-would-you-model-this-thanks-for-any-suggestions/152091)

<div class="topic-metadata">

**Author:** [@msmsms](https://www.ruby-forum.com/u/msmsms)\
**Replies:** 4\
**Last updated:** [October 30, 2008, 1:04pm UTC](https://www.ruby-forum.com/t/how-would-you-model-this-thanks-for-any-suggestions/152091 "2008-10-30T13:04:09Z")

</div>

Hello, maybe you can help me. I am looking for a reasonable way to model the following concept. Assuming, we have 2 entities: User (table users) Town (table towns) A user can, for example, add a town to the databas…

---

## [Query & compose an array](https://www.ruby-forum.com/t/query-compose-an-array/152131)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 12:28pm UTC](https://www.ruby-forum.com/t/query-compose-an-array/152131 "2008-10-30T12:28:51Z")

</div>

Hi there, What’s the correct & most efficient way to compose the following array? I have: Existing tables: users (:id) user\_languages (:id, :user\_id, :language\_id) languages (:id, :name) Existing array: @user\_langua…

---

## [Routing problem](https://www.ruby-forum.com/t/routing-problem/152123)

<div class="topic-metadata">

**Author:** [@raphael\_b](https://www.ruby-forum.com/u/raphael_b)\
**Replies:** 3\
**Last updated:** [October 30, 2008, 12:24pm UTC](https://www.ruby-forum.com/t/routing-problem/152123 "2008-10-30T12:24:08Z")

</div>

Hi, I’m developing an engine with a controller, and I have problems to configure the routing. The engine is located in vendor/plugins/web\_file\_attachment. Under that directory: the controller is in app/controllers…

---

## [How do i set the boolean value true](https://www.ruby-forum.com/t/how-do-i-set-the-boolean-value-true/152095)

<div class="topic-metadata">

**Author:** [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Replies:** 4\
**Last updated:** [October 30, 2008, 11:14am UTC](https://www.ruby-forum.com/t/how-do-i-set-the-boolean-value-true/152095 "2008-10-30T11:14:34Z")

</div>

i have seperate tables called “messages” and “replies” in messages,attributes are t.column :user\_id, :string t.column :msg\_id, :string t.column :inbox, :boolean t.column :sent, :boolean in repliest, attributes are …

---

## [Iframe](https://www.ruby-forum.com/t/iframe/152026)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 11:12am UTC](https://www.ruby-forum.com/t/iframe/152026 "2008-10-30T11:12:17Z")

</div>

Hi I have an application.In that an action create\_ui in controller service\_desk creates a service desk ticket. I have already written the required validations and completely implemented it. Now my new requirement is …

---

## [Blog::Post(Table doesn't exist)?](https://www.ruby-forum.com/t/blog-post-table-doesnt-exist/152125)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 10:59am UTC](https://www.ruby-forum.com/t/blog-post-table-doesnt-exist/152125 "2008-10-30T10:59:51Z")

</div>

Well, it’s as simple as the subject says :slight\_smile: Why does… class Blog::Post \< ActiveRecord::Base end …use “posts” table and not “blog\_posts”? even though migration file has created… create\_table blog\_posts d…

---

## [Stack level too deep](https://www.ruby-forum.com/t/stack-level-too-deep/152034)

<div class="topic-metadata">

**Author:** [@babysudha](https://www.ruby-forum.com/u/babysudha)\
**Replies:** 3\
**Last updated:** [October 30, 2008, 9:40am UTC](https://www.ruby-forum.com/t/stack-level-too-deep/152034 "2008-10-30T09:40:29Z")

</div>

Hi, i have worked on one website using Ruby On Rails.i have installed acts\_as\_attachment for authenticate the user.after that i have installed login\_engine plugin to try out some mail sending function.but i did not g…

---

## [Redirecting to an external url](https://www.ruby-forum.com/t/redirecting-to-an-external-url/152120)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 9:28am UTC](https://www.ruby-forum.com/t/redirecting-to-an-external-url/152120 "2008-10-30T09:28:47Z")

</div>

I have an application that needs to redirect to an external url in a new window directly from the controller. I have not been able to figure out how. Can someone give me some pointers. The URL is calculated based upon…

---

## [Email address as users nickname](https://www.ruby-forum.com/t/email-address-as-users-nickname/151904)

<div class="topic-metadata">

**Author:** [@golf](https://www.ruby-forum.com/u/golf)\
**Replies:** 2\
**Last updated:** [October 30, 2008, 8:54am UTC](https://www.ruby-forum.com/t/email-address-as-users-nickname/151904 "2008-10-30T08:54:34Z")

</div>

Hi, I would like to create a new email account for newly registered authors, but I wasn’t even able to find info, if it is possible or not. For example: users nick name: testuser my domain name: example.com and aut…

---

## [Page.replace\_html : How to update a DIV using a button](https://www.ruby-forum.com/t/page-replace-html-how-to-update-a-div-using-a-button/152084)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 3\
**Last updated:** [October 30, 2008, 8:25am UTC](https://www.ruby-forum.com/t/page-replace-html-how-to-update-a-div-using-a-button/152084 "2008-10-30T08:25:07Z")

</div>

I have this button which is supposed to update a DIV on the same page (using a partial). But it doesn’t. What am I missing here ?! VIEW: \<% form\_tag ‘/trees’ do -%\> \<%= submit\_to\_remote ‘new\_tree’, ‘Add a tree’, :url…

---

## [How to Catch a Status 401 with htpasswd?](https://www.ruby-forum.com/t/how-to-catch-a-status-401-with-htpasswd/151007)

<div class="topic-metadata">

**Author:** [@ziggles](https://www.ruby-forum.com/u/ziggles)\
**Replies:** 7\
**Last updated:** [October 30, 2008, 8:05am UTC](https://www.ruby-forum.com/t/how-to-catch-a-status-401-with-htpasswd/151007 "2008-10-30T08:05:46Z")

</div>

Hi All, I would love to hear your thoughts on this. I am using the htpasswd plugin located here: http://wota.jp/svn/rails/plugins/branches/stable/htpasswd/ To validate access against a .htpasswd file. The plugin is …

---

## [Select helper](https://www.ruby-forum.com/t/select-helper/152114)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [October 30, 2008, 6:43am UTC](https://www.ruby-forum.com/t/select-helper/152114 "2008-10-30T06:43:18Z")

</div>

I am trying to figure out how to use the “select” helper in changing a scaffold produced “new.html.erb” file. Specifically how do I change: Year In School: \<%= f.text\_field :year %\> so that this shows up as a “dr…

---

## [Nested Resouces,not getting parent id(project\_id) from form](https://www.ruby-forum.com/t/nested-resouces-not-getting-parent-id-project-id-from-form/152112)

<div class="topic-metadata">

**Author:** [@srijith](https://www.ruby-forum.com/u/srijith)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 6:18am UTC](https://www.ruby-forum.com/t/nested-resouces-not-getting-parent-id-project-id-from-form/152112 "2008-10-30T06:18:15Z")

</div>

Hi i am using nested resources,here project having has many relation with defects. Main problem here is i am not getting project\_id from edit form.What’s a problem if any one knows please help. edit.html.erb \<% for…

---

## [ActionMailer](https://www.ruby-forum.com/t/actionmailer/152094)

<div class="topic-metadata">

**Author:** [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 5:22am UTC](https://www.ruby-forum.com/t/actionmailer/152094 "2008-10-30T05:22:28Z")

</div>

can anyone tell me what is the purpose of having ActionMailer

---

## [Namespace helpers](https://www.ruby-forum.com/t/namespace-helpers/152109)

<div class="topic-metadata">

**Author:** [@obenhauser](https://www.ruby-forum.com/u/obenhauser)\
**Replies:** 4\
**Last updated:** [October 30, 2008, 5:19am UTC](https://www.ruby-forum.com/t/namespace-helpers/152109 "2008-10-30T05:19:47Z")

</div>

I have two people\_controller and people\_helper. One in the controller and helper directory and the other in the controller/admin and helper/ admin namespace. The reason I have two controllers is because I want diffe…

---

## [Problem creating Hello World app in Ruby on Rails](https://www.ruby-forum.com/t/problem-creating-hello-world-app-in-ruby-on-rails/152025)

<div class="topic-metadata">

**Author:** [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Replies:** 3\
**Last updated:** [October 30, 2008, 4:15am UTC](https://www.ruby-forum.com/t/problem-creating-hello-world-app-in-ruby-on-rails/152025 "2008-10-30T04:15:58Z")

</div>

Hi All, I just installed Ruby on Rails on my MacBook Pro and tried to create the Hello World app that is documented in the Agile Development with Rails book. I followed all the instructions for creating the Hello Wor…

---

## [RJS problem after upgrading to Rails 2.0.2](https://www.ruby-forum.com/t/rjs-problem-after-upgrading-to-rails-2-0-2/152086)

<div class="topic-metadata">

**Author:** [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 12:14am UTC](https://www.ruby-forum.com/t/rjs-problem-after-upgrading-to-rails-2-0-2/152086 "2008-10-30T00:14:43Z")

</div>

I just updated an old app from 1.2.6 to 2.0.2 and I’m having an rjs problem. I have one page that has 2 submit to remote buttons, one to do a price override and the other to remove the lineitem. Everything is working …

---

## [About regular expression](https://www.ruby-forum.com/t/about-regular-expression/152067)

<div class="topic-metadata">

**Author:** [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 12:12am UTC](https://www.ruby-forum.com/t/about-regular-expression/152067 "2008-10-30T00:12:23Z")

</div>

how to use regular expression to from: s=" sdfsdfdsdsf 4567sdflk ddd testhgkhgj " get resultString=“ sdfsdfdsdsf 4567sdflk ddd testhgkhgj ”

---

## [Scaffolding and dealing with generated actions in the controllers](https://www.ruby-forum.com/t/scaffolding-and-dealing-with-generated-actions-in-the-controllers/151992)

<div class="topic-metadata">

**Author:** [@command0](https://www.ruby-forum.com/u/command0)\
**Replies:** 2\
**Last updated:** [October 29, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/scaffolding-and-dealing-with-generated-actions-in-the-controllers/151992 "2008-10-29T22:41:02Z")

</div>

Hey Everyone, I wanted to know if I could get some insight on something. I am using Rails 2.1.2 and for something that needs beyond basic functionality, I typically generate a scaffold so I don’t have to manually crea…

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

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