# Rails

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

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

---

## [\[PLUGIN\] count\_from\_query - easily convert finder queries in](https://www.ruby-forum.com/t/plugin-count-from-query-easily-convert-finder-queries-in/91060)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 1\
**Last updated:** [April 4, 2007, 9:21am UTC](https://www.ruby-forum.com/t/plugin-count-from-query-easily-convert-finder-queries-in/91060 "2007-04-04T09:21:54Z")

</div>

count\_from\_query gives you the ability to generate a COUNT query from a standard Rails find. For example, if you have the query User.find :all it would be trivial to get a count: User.count however, if you have a m…

---

## [Ajax on Rails](https://www.ruby-forum.com/t/ajax-on-rails/90815)

<div class="topic-metadata">

**Author:** [@mick](https://www.ruby-forum.com/u/mick)\
**Replies:** 5\
**Last updated:** [April 4, 2007, 9:17am UTC](https://www.ruby-forum.com/t/ajax-on-rails/90815 "2007-04-04T09:17:54Z")

</div>

Hi guys, I’m starting to meddle a bit with the inbuilt Ajax functionality that Rails offers, and would like a little help of possible! I have following Ajax link: \<%= link\_to\_remote “read”, :update =\> ‘wrapper’, :url…

---

## [Select\_tag selected value?](https://www.ruby-forum.com/t/select-tag-selected-value/90610)

<div class="topic-metadata">

**Author:** [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Replies:** 1\
**Last updated:** [April 4, 2007, 8:31am UTC](https://www.ruby-forum.com/t/select-tag-selected-value/90610 "2007-04-04T08:31:57Z")

</div>

Situation: Administrative control panel which lists users and allows mass updates of attributes from a single screen. My code: \<%= select\_tag(“person\[#{person.id}\]\[role\]”, 'user admin', options = {:selected =\> perso…

---

## [Problem with select\_tag](https://www.ruby-forum.com/t/problem-with-select-tag/86048)

<div class="topic-metadata">

**Author:** [@trupti](https://www.ruby-forum.com/u/trupti)\
**Replies:** 3\
**Last updated:** [April 4, 2007, 8:23am UTC](https://www.ruby-forum.com/t/problem-with-select-tag/86048 "2007-04-04T08:23:30Z")

</div>

hi friends, i have used select\_tag for country selection. in this select\_tag i want to make one of the option by default selected. how to do it? plz somebody help me. code: .rhtml \<%= select\_tag “country”, options\_…

---

## [Rejecting multiple requests within same session](https://www.ruby-forum.com/t/rejecting-multiple-requests-within-same-session/91062)

<div class="topic-metadata">

**Author:** [@yottameter](https://www.ruby-forum.com/u/yottameter)\
**Replies:** 0\
**Last updated:** [April 4, 2007, 7:39am UTC](https://www.ruby-forum.com/t/rejecting-multiple-requests-within-same-session/91062 "2007-04-04T07:39:44Z")

</div>

I’m seeing a situation where two requests with the same session id are being processed at the same time. Is there a way to make sure that if a request is being handled for a session, that request completes before allo…

---

## [Webrick startup problem](https://www.ruby-forum.com/t/webrick-startup-problem/91061)

<div class="topic-metadata">

**Author:** [@sanand83](https://www.ruby-forum.com/u/sanand83)\
**Replies:** 0\
**Last updated:** [April 4, 2007, 7:19am UTC](https://www.ruby-forum.com/t/webrick-startup-problem/91061 "2007-04-04T07:19:38Z")

</div>

I had my application running perfectly in the 1.8.2th version of ruby. Now I have updated the version of ruby to 1.8.6(through the one-click installer). I again installed the rails,uuid, and all other plugins. I am ab…

---

## [Easy one](https://www.ruby-forum.com/t/easy-one/91057)

<div class="topic-metadata">

**Author:** [@rails.impaired](https://www.ruby-forum.com/u/rails.impaired)\
**Replies:** 1\
**Last updated:** [April 4, 2007, 6:38am UTC](https://www.ruby-forum.com/t/easy-one/91057 "2007-04-04T06:38:30Z")

</div>

I have the following piece of code in an app: @states = LookupValue.find(:all, :conditions =\> \['record\_type = ?', ‘STATE’\], :order =\> “char\_value\_1”).map {|u| \[u.char\_value\_1, u.id\] } Thi…

---

## [ArgumentError - AuthenticatedSystem](https://www.ruby-forum.com/t/argumenterror-authenticatedsystem/91056)

<div class="topic-metadata">

**Author:** [@nielsene](https://www.ruby-forum.com/u/nielsene)\
**Replies:** 0\
**Last updated:** [April 4, 2007, 5:55am UTC](https://www.ruby-forum.com/t/argumenterror-authenticatedsystem/91056 "2007-04-04T05:55:39Z")

</div>

Any idea what would cause this error and how to fix it? It might be caused by trying to access the server concurrently with the same user. I found a reference to a similar bug but it should have already been fixed. I’…

---

## [With\_scope :limit is ignored when I do an association](https://www.ruby-forum.com/t/with-scope-limit-is-ignored-when-i-do-an-association/91052)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 0\
**Last updated:** [April 4, 2007, 3:59am UTC](https://www.ruby-forum.com/t/with-scope-limit-is-ignored-when-i-do-an-association/91052 "2007-04-04T03:59:33Z")

</div>

c is a Company and c has\_many :videos. Video.with\_scope(:find =\> { :limit =\> 5 }) { c.videos }.size =\> 13 it works though when I don’t use the association Video.with\_scope(:find =\> { :limit =\> 5 }) { Video.find…

---

## [Stupid postgresql test fixtures](https://www.ruby-forum.com/t/stupid-postgresql-test-fixtures/89083)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [April 4, 2007, 3:02am UTC](https://www.ruby-forum.com/t/stupid-postgresql-test-fixtures/89083 "2007-04-04T03:02:31Z")

</div>

Hi, So, I’ve got a postgresql database with referential integrity on the foreign keys. It’s a pain in the ass because I get a ton of errors like this if I don’t have each test load fixtures in exactly the right orde…

---

## [First post - InstantRails issues](https://www.ruby-forum.com/t/first-post-instantrails-issues/91022)

<div class="topic-metadata">

**Author:** [@dgaj](https://www.ruby-forum.com/u/dgaj)\
**Replies:** 2\
**Last updated:** [April 4, 2007, 2:25am UTC](https://www.ruby-forum.com/t/first-post-instantrails-issues/91022 "2007-04-04T02:25:25Z")

</div>

Hi all. I have just installed InstantRails on my XP box, generated the application skeleton, created my databases, edited database.yml, created a model and controller, edited the controller to contain some method stu…

---

## [Annoying NoMethodError](https://www.ruby-forum.com/t/annoying-nomethoderror/225944)

<div class="topic-metadata">

**Author:** [@solidariti](https://www.ruby-forum.com/u/solidariti)\
**Replies:** 0\
**Last updated:** [April 4, 2007, 1:37am UTC](https://www.ruby-forum.com/t/annoying-nomethoderror/225944 "2007-04-04T01:37:27Z")

</div>

Annoying NoMethodError in Admin/project#show when I try to edit and save a project and view a project by clicking on \<%= link\_to c.title, {:action =\> ‘show’, :id =\> c.id} -%\> Showing app/views/admin/project/show.rhtml…

---

## [A fix for an annoying bug](https://www.ruby-forum.com/t/a-fix-for-an-annoying-bug/91042)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [April 4, 2007, 1:04am UTC](https://www.ruby-forum.com/t/a-fix-for-an-annoying-bug/91042 "2007-04-04T01:04:16Z")

</div>

so…say you setup your models and they work well except on one certain page? It replies with: uninitialized constant UserBlendedCastController::Filter What may be the problem is that if you use Dir.chdir then it may n…

---

## [Redirect\_to an uncertain hash](https://www.ruby-forum.com/t/redirect-to-an-uncertain-hash/90892)

<div class="topic-metadata">

**Author:** [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Replies:** 2\
**Last updated:** [April 4, 2007, 12:48am UTC](https://www.ruby-forum.com/t/redirect-to-an-uncertain-hash/90892 "2007-04-04T00:48:25Z")

</div>

I am trying to deal with a redirection based upon what to do after a session has expired. I take the params hash and stuff it into a new session as part of the new login and then after login, I want to redirect to thi…

---

## [Webrick with netbios alias not working](https://www.ruby-forum.com/t/webrick-with-netbios-alias-not-working/91035)

<div class="topic-metadata">

**Author:** [@dan](https://www.ruby-forum.com/u/dan)\
**Replies:** 0\
**Last updated:** [April 3, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/webrick-with-netbios-alias-not-working/91035 "2007-04-03T23:43:21Z")

</div>

Hi, I added a WINS alias in samba (netbios aliases = foo-bar), but my rails app only works if I use the IP address. WEBrick starts fine, but when I goto http://foo-bar:3000, I get the following message: We’re sorry,…

---

## [Multiple virtual host?](https://www.ruby-forum.com/t/multiple-virtual-host/90874)

<div class="topic-metadata">

**Author:** [@dankitania](https://www.ruby-forum.com/u/dankitania)\
**Replies:** 10\
**Last updated:** [April 3, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/multiple-virtual-host/90874 "2007-04-03T23:40:03Z")

</div>

I am trying to serve up two applications from one box. (It’s not a commercial system; it’s just a box on my desktop, that I’m using to test out RoR.) SETUP. In my httpd.conf, I’ve got something like \<VirtualHost \*:8…

---

## [Newbie... Layouts and how to create universal header through](https://www.ruby-forum.com/t/newbie-layouts-and-how-to-create-universal-header-through/90807)

<div class="topic-metadata">

**Author:** [@AbsolutZero](https://www.ruby-forum.com/u/AbsolutZero)\
**Replies:** 3\
**Last updated:** [April 3, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/newbie-layouts-and-how-to-create-universal-header-through/90807 "2007-04-03T23:10:19Z")

</div>

I have a simple question that I’m sure will be painful to answer for some of you experts, but I thank you for bearing with me… I want a simple 5-page website. I have a custom header consisting of a simple banner and h…

---

## [Has\_many :through associated object ids assignment error](https://www.ruby-forum.com/t/has-many-through-associated-object-ids-assignment-error/91018)

<div class="topic-metadata">

**Author:** [@Bas\_van\_Westing](https://www.ruby-forum.com/u/Bas_van_Westing)\
**Replies:** 2\
**Last updated:** [April 3, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/has-many-through-associated-object-ids-assignment-error/91018 "2007-04-03T23:01:53Z")

</div>

Hi, I have the following situation: class Article \< ActiveRecord::Base has\_many :readings has\_many :users, :through =\> :readings end class Reading \< ActiveRecord::Base belongs\_to :article belongs\_to :user end N…

---

## [Where clause for a has\_many](https://www.ruby-forum.com/t/where-clause-for-a-has-many/91005)

<div class="topic-metadata">

**Author:** [@jason](https://www.ruby-forum.com/u/jason)\
**Replies:** 1\
**Last updated:** [April 3, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/where-clause-for-a-has-many/91005 "2007-04-03T22:59:17Z")

</div>

I have two models, History and SalesOrder, which are setup like this: class History \< ActiveRecord::Base belongs\_to :sales\_order end class SalesOrder \< ActiveRecord::Base has\_many :histories has\_many :latest\_histor…

---

## [Not showing dates \< Date.today in date\_select](https://www.ruby-forum.com/t/not-showing-dates-date-today-in-date-select/91030)

<div class="topic-metadata">

**Author:** [@Jorge\_Mario\_GSMazo](https://www.ruby-forum.com/u/Jorge_Mario_GSMazo)\
**Replies:** 0\
**Last updated:** [April 3, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/not-showing-dates-date-today-in-date-select/91030 "2007-04-03T22:51:17Z")

</div>

HI there how do I tell date\_select not to show the dates below Date.today actually Date.today + 14 Thanks in advance

---

## [Syslog logger performance](https://www.ruby-forum.com/t/syslog-logger-performance/91032)

<div class="topic-metadata">

**Author:** [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Replies:** 0\
**Last updated:** [April 3, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/syslog-logger-performance/91032 "2007-04-03T22:51:17Z")

</div>

I have the syslog logger from the rails analyzer gem installed, and I’m curious if anyone else has used it in production and has comments on the performance hit they took, particularly when logging to syslogd on the s…

---

## [DoubleRender Question: who can answer?](https://www.ruby-forum.com/t/doublerender-question-who-can-answer/91006)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 5\
**Last updated:** [April 3, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/doublerender-question-who-can-answer/91006 "2007-04-03T22:30:13Z")

</div>

Hello. In my application controller, I have a function like this: def is\_owner\_or\_admin(user\_id) if cur\_user.role != “Admin” && cur\_user.id != Integer(user\_id) flash\[:error\] = “Access denied” redirect\_to(:controller…

---

## [Displaying mapped values from the database](https://www.ruby-forum.com/t/displaying-mapped-values-from-the-database/102736)

<div class="topic-metadata">

**Author:** [@drlelon](https://www.ruby-forum.com/u/drlelon)\
**Replies:** 4\
**Last updated:** [April 3, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/displaying-mapped-values-from-the-database/102736 "2007-04-03T21:53:07Z")

</div>

Hi, I have values in my database stored as integers: 1, 2, 3, 4, 5 When I retrieve and display these values in a List or Show, I want to map them to text such as: Text1, Text2, Text3, Text4, Text5 What’s the easies…

---

## [Link\_to\_remote and SSL problem](https://www.ruby-forum.com/t/link-to-remote-and-ssl-problem/91021)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 0\
**Last updated:** [April 3, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/link-to-remote-and-ssl-problem/91021 "2007-04-03T21:45:06Z")

</div>

I’m having trouble with link\_to\_remote on an SSL page. I have a form that includes multiple items (multiple instances of one model). I use link\_to\_remote to an RJS function to allow the user to delete items. The delet…

---

## [Fowler style "Two Step View" implementation](https://www.ruby-forum.com/t/fowler-style-two-step-view-implementation/90968)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 4\
**Last updated:** [April 3, 2007, 9:21pm UTC](https://www.ruby-forum.com/t/fowler-style-two-step-view-implementation/90968 "2007-04-03T21:21:39Z")

</div>

Hey All I have a situation where I would like to try and build in a Fowler style “Two Step View” as the domain logic is always the same but the front end needs to be tottaly a difffert look and feel. In fowlers terms…

---

## [REST and nested resources more than one level?](https://www.ruby-forum.com/t/rest-and-nested-resources-more-than-one-level/90904)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [April 3, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/rest-and-nested-resources-more-than-one-level/90904 "2007-04-03T20:39:54Z")

</div>

Is it possible to nest a resource more than a single level? For example something like this: map.resources :articles do |article| article.resources :comments do |comment| comment.resources :foo end end – Sterling…

---

## [Model class as join table](https://www.ruby-forum.com/t/model-class-as-join-table/90991)

<div class="topic-metadata">

**Author:** [@Rod](https://www.ruby-forum.com/u/Rod)\
**Replies:** 2\
**Last updated:** [April 3, 2007, 7:11pm UTC](https://www.ruby-forum.com/t/model-class-as-join-table/90991 "2007-04-03T19:11:45Z")

</div>

I’m a Ruby noob, and I’m pretty convinced there’s an elegant way to implement what I’m trying to do. I thought I’d ask if there’s any idioms I could use. Two classes: “team” and “member” joined in a team\_members tabl…

---

## [Authentication and Authorization](https://www.ruby-forum.com/t/authentication-and-authorization/91001)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [April 3, 2007, 6:36pm UTC](https://www.ruby-forum.com/t/authentication-and-authorization/91001 "2007-04-03T18:36:39Z")

</div>

Hi! I have a question about authentication and authorization. I would like to authenticate users through apache, and pass their username across into rails. In rails, I have a table in my database called ‘people’, a…

---

## [End\_form\_tag](https://www.ruby-forum.com/t/end-form-tag/90997)

<div class="topic-metadata">

**Author:** [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Replies:** 3\
**Last updated:** [April 3, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/end-form-tag/90997 "2007-04-03T18:32:39Z")

</div>

In my logs I can see that end\_form\_tag is being deprecated. I wanted to make the switch now but cannot get the new end tag to work. THIS WORKS: \<%= form\_remote\_tag :url =\>{:action =\> "next\_question", …

---

## [Problem met symlink](https://www.ruby-forum.com/t/problem-met-symlink/90999)

<div class="topic-metadata">

**Author:** [@kreatos7](https://www.ruby-forum.com/u/kreatos7)\
**Replies:** 0\
**Last updated:** [April 3, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/problem-met-symlink/90999 "2007-04-03T18:21:24Z")

</div>

I have installed a rails application “shop” on my root folder. The document folder is /public\_html I created a symlink ln -s ~/shop/public ~/public\_html Now when i direct my browser to the domain it isnÂ´t giving the…

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

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