# Rails

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

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

---

## [Ruby 1.9.x Rails Performance](https://www.ruby-forum.com/t/ruby-1-9-x-rails-performance/172492)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 1\
**Last updated:** [July 22, 2009, 11:17am UTC](https://www.ruby-forum.com/t/ruby-1-9-x-rails-performance/172492 "2009-07-22T11:17:49Z")

</div>

Hello All, I read an article a while back about performance in Ruby. I remember a lot of talk about vast improvements in ruby 1.9.x (completely new compiler code). I’m thinking about making the upgrade on my Redhat 5 …

---

## [How can I implement authentication in my API?](https://www.ruby-forum.com/t/how-can-i-implement-authentication-in-my-api/170488)

<div class="topic-metadata">

**Author:** [@andrew](https://www.ruby-forum.com/u/andrew)\
**Replies:** 7\
**Last updated:** [July 22, 2009, 11:10am UTC](https://www.ruby-forum.com/t/how-can-i-implement-authentication-in-my-api/170488 "2009-07-22T11:10:48Z")

</div>

I’m developing an API for my site, and I’m wondering how I can make it so requests require basic access authentication (like in Twitter’s API for example)? I’m using restful-authentication on Rails 2.3.2. Thanks!

---

## [Http basic authentication and restful authentication](https://www.ruby-forum.com/t/http-basic-authentication-and-restful-authentication/172198)

<div class="topic-metadata">

**Author:** [@wouter](https://www.ruby-forum.com/u/wouter)\
**Replies:** 1\
**Last updated:** [July 22, 2009, 11:10am UTC](https://www.ruby-forum.com/t/http-basic-authentication-and-restful-authentication/172198 "2009-07-22T11:10:13Z")

</div>

hey, I have created a web app in Ruby On Rails and users can login and register with resftul authentication. Now I am creating an Android application where the user can access some parts of the website (xml resources…

---

## [Model attached to model validation](https://www.ruby-forum.com/t/model-attached-to-model-validation/172407)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 5\
**Last updated:** [July 22, 2009, 10:41am UTC](https://www.ruby-forum.com/t/model-attached-to-model-validation/172407 "2009-07-22T10:41:33Z")

</div>

I have a model say “site” and another model “equipment”. In the Site form I can attach equipment dynamically in the form and the equipment has attributes in the :through table. Is there a way to validate the equipmen…

---

## [Rails nested resource issue](https://www.ruby-forum.com/t/rails-nested-resource-issue/172430)

<div class="topic-metadata">

**Author:** [@niczm25](https://www.ruby-forum.com/u/niczm25)\
**Replies:** 1\
**Last updated:** [July 22, 2009, 10:19am UTC](https://www.ruby-forum.com/t/rails-nested-resource-issue/172430 "2009-07-22T10:19:17Z")

</div>

I have a couple of resources, a grant\_application, and a household which are related with a has\_one class GrantApplication \< ActiveRecord::Base has\_one :household, :dependent =\> :destroy end class Household \< Active…

---

## [Machinist - having problems stubbing an after\_create filter](https://www.ruby-forum.com/t/machinist-having-problems-stubbing-an-after-create-filter/172444)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 2\
**Last updated:** [July 22, 2009, 10:17am UTC](https://www.ruby-forum.com/t/machinist-having-problems-stubbing-an-after-create-filter/172444 "2009-07-22T10:17:57Z")

</div>

Hi all I’m moving to using Machinist in my rspec tests and am having a problem with an after\_create callback method that i need to stub out. It seems like calling ClassName.make will trigger this callback before i’ve…

---

## [My first app with RoR problem](https://www.ruby-forum.com/t/my-first-app-with-ror-problem/172411)

<div class="topic-metadata">

**Author:** [@Renzo](https://www.ruby-forum.com/u/Renzo)\
**Replies:** 9\
**Last updated:** [July 22, 2009, 9:40am UTC](https://www.ruby-forum.com/t/my-first-app-with-ror-problem/172411 "2009-07-22T09:40:44Z")

</div>

C:\\Ruby\\SITES\\helloworld\>ruby script/server =\> Booting WEBrick =\> Rails 2.3.2 application starting on http://0.0.0.0:3000 =\> Call with -d to detach =\> Ctrl-C to shutdown server \[2009-07-21 10:01:54\] INFO WEBrick 1.…

---

## [Arrays in Ruby](https://www.ruby-forum.com/t/arrays-in-ruby/172486)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 0\
**Last updated:** [July 22, 2009, 8:42am UTC](https://www.ruby-forum.com/t/arrays-in-ruby/172486 "2009-07-22T08:42:51Z")

</div>

Hi Champs, The scenario is something like this … I am having an array which consists of elements as:- array\[0\] = dayName; array\[1\] = date; array\[2\] = AnotherDayname … may be same … array\[3\] = anotherdate … may be s…

---

## [Issue with printing doc to default printer without popup dialogue box](https://www.ruby-forum.com/t/issue-with-printing-doc-to-default-printer-without-popup-dialogue-box/172482)

<div class="topic-metadata">

**Author:** [@Ravikanth\_Nawada](https://www.ruby-forum.com/u/Ravikanth_Nawada)\
**Replies:** 0\
**Last updated:** [July 22, 2009, 7:31am UTC](https://www.ruby-forum.com/t/issue-with-printing-doc-to-default-printer-without-popup-dialogue-box/172482 "2009-07-22T07:31:36Z")

</div>

Hi How can i print the document to a default printer without pop up dialog box. – â€œKnowing others is intelligence; knowing yourself is true wisdom. Mastering others is strength; mastering yourself is true pow…

---

## [Rails Application Performance](https://www.ruby-forum.com/t/rails-application-performance/172432)

<div class="topic-metadata">

**Author:** [@railslist](https://www.ruby-forum.com/u/railslist)\
**Replies:** 4\
**Last updated:** [July 22, 2009, 6:27am UTC](https://www.ruby-forum.com/t/rails-application-performance/172432 "2009-07-22T06:27:18Z")

</div>

I have recently finished a very small application in Rails. This application can be found @ http://www.classifieds.org.in Currently, I manage user view state using sessions. For example to hold current city, current …

---

## [Auto\_Complete plugin with results from two tables](https://www.ruby-forum.com/t/auto-complete-plugin-with-results-from-two-tables/172422)

<div class="topic-metadata">

**Author:** [@benoror](https://www.ruby-forum.com/u/benoror)\
**Replies:** 13\
**Last updated:** [July 22, 2009, 4:09am UTC](https://www.ruby-forum.com/t/auto-complete-plugin-with-results-from-two-tables/172422 "2009-07-22T04:09:17Z")

</div>

Hi people, I’m trying to use the auto\_complete plugin in rails 2.3.2 for searching from two tables. I’ve researched a lot but I can’t make it work. This is my code: ------- Application Controller: ------- class Appli…

---

## [\[ADV\] Black/Kastner Ruby training: for non-beginners?](https://www.ruby-forum.com/t/adv-black-kastner-ruby-training-for-non-beginners/172463)

<div class="topic-metadata">

**Author:** [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Replies:** 0\
**Last updated:** [July 21, 2009, 11:27pm UTC](https://www.ruby-forum.com/t/adv-black-kastner-ruby-training-for-non-beginners/172463 "2009-07-21T23:27:40Z")

</div>

Hi all – If you’re thinking about taking our Ruby training (me and Erik Kastner) but you’re not a Ruby beginner… …or should I say, if you’re not a beginner and therefore NOT thinking about taking our Ruby training… ……

---

## [STI include in find](https://www.ruby-forum.com/t/sti-include-in-find/172455)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 21, 2009, 11:06pm UTC](https://www.ruby-forum.com/t/sti-include-in-find/172455 "2009-07-21T23:06:02Z")

</div>

Hi, I am using single table inheritance in my application as follows: class Company \< ActiveRecord::Base … end class Member \< Company … end class Applicant \< Company … end class Application \< ActiveRecord::Ba…

---

## [Synatx error while running migration](https://www.ruby-forum.com/t/synatx-error-while-running-migration/172451)

<div class="topic-metadata">

**Author:** [@virendra](https://www.ruby-forum.com/u/virendra)\
**Replies:** 1\
**Last updated:** [July 21, 2009, 11:02pm UTC](https://www.ruby-forum.com/t/synatx-error-while-running-migration/172451 "2009-07-21T23:02:31Z")

</div>

hello to all, i am getting weird syntax error while running the rake db:migrate syntax error, unexpected tSYMBEG, expecting kDO or ‘{’ or ‘(’ Apparently i am creating an engine in my main application using ‘ruby scri…

---

## [HttpMock Post Parameters](https://www.ruby-forum.com/t/httpmock-post-parameters/171693)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 21, 2009, 10:36pm UTC](https://www.ruby-forum.com/t/httpmock-post-parameters/171693 "2009-07-21T22:36:12Z")

</div>

Does anyone know how you can specify the body of an HttpMock post as well as the body of the response? I’m trying to test a restful API where the parameters are posted in in the body of the post as XML and the respons…

---

## [Strategy for storing/accessing custom attributes?](https://www.ruby-forum.com/t/strategy-for-storing-accessing-custom-attributes/172221)

<div class="topic-metadata">

**Author:** [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Replies:** 4\
**Last updated:** [July 21, 2009, 9:34pm UTC](https://www.ruby-forum.com/t/strategy-for-storing-accessing-custom-attributes/172221 "2009-07-21T21:34:14Z")

</div>

I’m working on a contact management app and 3 of the requirements are: the user should be able to add additional custom Contact fields (e.g. an extra phone number that isnt provided in the std set of fields) the user…

---

## [ActiveRecord model that uses two tables (kind of like UNION](https://www.ruby-forum.com/t/activerecord-model-that-uses-two-tables-kind-of-like-union/105627)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [July 21, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/activerecord-model-that-uses-two-tables-kind-of-like-union/105627 "2009-07-21T20:50:17Z")

</div>

Hi, I’m sitting here pondering about how to solve this DB/AR related problem. Being new to RoR it’s kind of difficult as I DO know how to use the tools below the surface, but not all of the ActiveRecord Super Powers. …

---

## [Prob with address field import using vPim/vCard](https://www.ruby-forum.com/t/prob-with-address-field-import-using-vpim-vcard/172454)

<div class="topic-metadata">

**Author:** [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Replies:** 0\
**Last updated:** [July 21, 2009, 8:43pm UTC](https://www.ruby-forum.com/t/prob-with-address-field-import-using-vpim-vcard/172454 "2009-07-21T20:43:23Z")

</div>

I’m successfully using the vpim/vcard gem to import from a vcard file except for one part… the physical address fields. the docs are pretty sketchy and there isnt much when you google for info, so I’m wondering if any…

---

## [Testing: be\_new\_record](https://www.ruby-forum.com/t/testing-be-new-record/172368)

<div class="topic-metadata">

**Author:** [@Matthias\_Baumgart](https://www.ruby-forum.com/u/Matthias_Baumgart)\
**Replies:** 2\
**Last updated:** [July 21, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/testing-be-new-record/172368 "2009-07-21T20:26:26Z")

</div>

Hello, in the railscast episode 71, Ryan uses in a test be\_new\_record. Running tests with be\_new\_record causes a NameError: undefined local variable or method. The episode isn’t on git and I didn’t find the code. I i…

---

## [Select dropdown for belongs\_to field](https://www.ruby-forum.com/t/select-dropdown-for-belongs-to-field/172332)

<div class="topic-metadata">

**Author:** [@skunkwerk](https://www.ruby-forum.com/u/skunkwerk)\
**Replies:** 1\
**Last updated:** [July 21, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/select-dropdown-for-belongs-to-field/172332 "2009-07-21T20:08:34Z")

</div>

Hi, I have a ‘person’ model that belongs\_to a ‘group’ model. I used scaffolding to generate the form code for adding a new person, but I want a select drop-down for selecting which group to assign a person to. I lo…

---

## [Problems with readonly attributes](https://www.ruby-forum.com/t/problems-with-readonly-attributes/172450)

<div class="topic-metadata">

**Author:** [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Replies:** 2\
**Last updated:** [July 21, 2009, 7:57pm UTC](https://www.ruby-forum.com/t/problems-with-readonly-attributes/172450 "2009-07-21T19:57:13Z")

</div>

Hi all, I have an editing form in which only one field must be editable;the other ones being readonly.Is there some way to automatize it,so I donÂ´t have to modify all fields by hand? Thanks, Rafael R.

---

## [Project Code Decision](https://www.ruby-forum.com/t/project-code-decision/172397)

<div class="topic-metadata">

**Author:** [@eric](https://www.ruby-forum.com/u/eric)\
**Replies:** 4\
**Last updated:** [July 21, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/project-code-decision/172397 "2009-07-21T19:40:56Z")

</div>

Hello Everyone, My name is Eric. I will be starting a large project soon and I have a few questions. I will be creating a browser based sports simulator. Users will be able to create a player or a coach and ether co…

---

## [Empty string and nil values help needed](https://www.ruby-forum.com/t/empty-string-and-nil-values-help-needed/172435)

<div class="topic-metadata">

**Author:** [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Replies:** 6\
**Last updated:** [July 21, 2009, 7:12pm UTC](https://www.ruby-forum.com/t/empty-string-and-nil-values-help-needed/172435 "2009-07-21T19:12:11Z")

</div>

I have done many variations of this code. Essentially I want this to be true. assert\_equal ‘’, Org.field\_for(nil).display This is a polymorphic relationship. fieldable.rb def field\_for(purpose) self.fields.find( :…

---

## [Some help with metric-fu](https://www.ruby-forum.com/t/some-help-with-metric-fu/172449)

<div class="topic-metadata">

**Author:** [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Replies:** 0\
**Last updated:** [July 21, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/some-help-with-metric-fu/172449 "2009-07-21T18:15:48Z")

</div>

I’m apologize for my English, before. I’m doing a post graduation thesis about BDD, an my initial idea is to compare a ruby program built by TDD and after by BDD. In these cases, the both projects have identical code,…

---

## ['document.observe' and a variable generated in controller](https://www.ruby-forum.com/t/document-observe-and-a-variable-generated-in-controller/172445)

<div class="topic-metadata">

**Author:** [@jimb](https://www.ruby-forum.com/u/jimb)\
**Replies:** 0\
**Last updated:** [July 21, 2009, 4:57pm UTC](https://www.ruby-forum.com/t/document-observe-and-a-variable-generated-in-controller/172445 "2009-07-21T16:57:40Z")

</div>

I have a java script function which I want to call once the page has loaded. Initially it looked like this: I was then advised by people on this forum that it is good practice to put this into an external js file th…

---

## [Text\_fields and habtm](https://www.ruby-forum.com/t/text-fields-and-habtm/172429)

<div class="topic-metadata">

**Author:** [@enzor](https://www.ruby-forum.com/u/enzor)\
**Replies:** 1\
**Last updated:** [July 21, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/text-fields-and-habtm/172429 "2009-07-21T16:55:51Z")

</div>

how can i set the text\_fields to put data into a model with habtm bindings? Example: model1 has\_and\_belongs\_to\_many :model2 how can i insert data into the references of model2 into model1?

---

## [Pagination](https://www.ruby-forum.com/t/pagination/172394)

<div class="topic-metadata">

**Author:** [@tanya](https://www.ruby-forum.com/u/tanya)\
**Replies:** 3\
**Last updated:** [July 21, 2009, 4:31pm UTC](https://www.ruby-forum.com/t/pagination/172394 "2009-07-21T16:31:21Z")

</div>

Hi, I am new to rails and developing a networking site.I am finding difficulty with pagination since i am working on rails 2.0.0. can somebody help me with the definition of paginate function. Thanx

---

## [Backporting C version of Array.combination to ruby 1.86](https://www.ruby-forum.com/t/backporting-c-version-of-array-combination-to-ruby-1-86/172437)

<div class="topic-metadata">

**Author:** [@karl](https://www.ruby-forum.com/u/karl)\
**Replies:** 0\
**Last updated:** [July 21, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/backporting-c-version-of-array-combination-to-ruby-1-86/172437 "2009-07-21T16:20:14Z")

</div>

I need a speedy version of the Array.combination method. Unfortunately the C implementation of this method is only available in ruby 1.87 while we are tied to 1.86. Is there a way to backport and monkey patch the com…

---

## [Is there anyway to get method name in view?](https://www.ruby-forum.com/t/is-there-anyway-to-get-method-name-in-view/172414)

<div class="topic-metadata">

**Author:** [@thriving](https://www.ruby-forum.com/u/thriving)\
**Replies:** 3\
**Last updated:** [July 21, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-get-method-name-in-view/172414 "2009-07-21T15:54:11Z")

</div>

I have tried to search in google with keyword “rails get method name in view” but i couldn’t find any answer In this case i want to get method name in view for example http://localhost:3000/todo/all\_project\_todos/14 …

---

## [Sending "flags" with link\_to](https://www.ruby-forum.com/t/sending-flags-with-link-to/172415)

<div class="topic-metadata">

**Author:** [@railslist](https://www.ruby-forum.com/u/railslist)\
**Replies:** 2\
**Last updated:** [July 21, 2009, 3:48pm UTC](https://www.ruby-forum.com/t/sending-flags-with-link-to/172415 "2009-07-21T15:48:39Z")

</div>

Let us say, I have a page with couple of links and i would like to send unique flag/variable settings through params for each these links when they are clicked. For example: A link clicked - flag ‘a’ sent B link cli…

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

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