# Rails

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

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

---

## [Execute ruby code on click](https://www.ruby-forum.com/t/execute-ruby-code-on-click/113429)

<div class="topic-metadata">

**Author:** [@max](https://www.ruby-forum.com/u/max)\
**Replies:** 2\
**Last updated:** [August 31, 2007, 3:02pm UTC](https://www.ruby-forum.com/t/execute-ruby-code-on-click/113429 "2007-08-31T15:02:42Z")

</div>

I have a number of links to external webpages and want to execute some Ruby code whenever one of them is clicked, e.g. log which URL was clicked how many times. To the user the links should behave as usual though. I’…

---

## [Test/Unit or RSpec](https://www.ruby-forum.com/t/test-unit-or-rspec/113455)

<div class="topic-metadata">

**Author:** [@buendia](https://www.ruby-forum.com/u/buendia)\
**Replies:** 3\
**Last updated:** [August 31, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/test-unit-or-rspec/113455 "2007-08-31T14:42:38Z")

</div>

Hi, I’m going to start my first real rails project, but I still can’t find the answer of this questions: What approach is better - TDD or BDD? Which of these two - Test/Unit or RSpec, makes tests easier to write, re…

---

## [Attaching a css class to a link\_to method](https://www.ruby-forum.com/t/attaching-a-css-class-to-a-link-to-method/113461)

<div class="topic-metadata">

**Author:** [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Replies:** 4\
**Last updated:** [August 31, 2007, 2:03pm UTC](https://www.ruby-forum.com/t/attaching-a-css-class-to-a-link-to-method/113461 "2007-08-31T14:03:30Z")

</div>

I’m trying to create links that have classes using link\_to. The only problem is I can’t figure out the syntax from the Rails API. It says this: link\_to(name, options = {}, html\_options = nil, \*parameters\_for\_method\_r…

---

## [Write array in model plugin](https://www.ruby-forum.com/t/write-array-in-model-plugin/113474)

<div class="topic-metadata">

**Author:** [@linus](https://www.ruby-forum.com/u/linus)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 1:41pm UTC](https://www.ruby-forum.com/t/write-array-in-model-plugin/113474 "2007-08-31T13:41:41Z")

</div>

Hello! I have a trivial problem… I want to pass list of Procs model like class SalesObject \< ActiveRecord::Base test1 = Proc.new do |obj| puts obj + " test1" true end test2 = Proc.new do |obj| puts obj + " test2…

---

## [SEO-friendly urls: Replacing the '-' with '%20'](https://www.ruby-forum.com/t/seo-friendly-urls-replacing-the-with-20/113472)

<div class="topic-metadata">

**Author:** [@dohmer](https://www.ruby-forum.com/u/dohmer)\
**Replies:** 2\
**Last updated:** [August 31, 2007, 1:28pm UTC](https://www.ruby-forum.com/t/seo-friendly-urls-replacing-the-with-20/113472 "2007-08-31T13:28:26Z")

</div>

Hi, I’m currently getting to grips with routing in rails, and it’s going pretty well. However, I have a small issue with inputting elements into the url which are more than one word, for example www.example.com/recipe…

---

## [\[Job opening\] Ruby on Rails Professionals](https://www.ruby-forum.com/t/job-opening-ruby-on-rails-professionals/113468)

<div class="topic-metadata">

**Author:** [@Azri\_Careers](https://www.ruby-forum.com/u/Azri_Careers)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 12:11pm UTC](https://www.ruby-forum.com/t/job-opening-ruby-on-rails-professionals/113468 "2007-08-31T12:11:09Z")

</div>

Dear Professionals, We are looking for ruby on rails professionals to work with us. We are setup at Hyderabad, India. A brief about the requirement :- Were looking for :- 1-2 years experience - Ruby on rails Linux u…

---

## [RoR on Fedora 7](https://www.ruby-forum.com/t/ror-on-fedora-7/196452)

<div class="topic-metadata">

**Author:** [@Chuob.Sok](https://www.ruby-forum.com/u/Chuob.Sok)\
**Replies:** 1\
**Last updated:** [August 31, 2007, 11:51am UTC](https://www.ruby-forum.com/t/ror-on-fedora-7/196452 "2007-08-31T11:51:51Z")

</div>

Dear All, I have configured to run my application of Ruby on Rail on Fedora 7. Actually, It is working well on localhost (Linux Fedora7). But I don’t know how to configure to run that application via the network. I …

---

## [Give focus to an input field of a form](https://www.ruby-forum.com/t/give-focus-to-an-input-field-of-a-form/113441)

<div class="topic-metadata">

**Author:** [@anoweb](https://www.ruby-forum.com/u/anoweb)\
**Replies:** 2\
**Last updated:** [August 31, 2007, 11:29am UTC](https://www.ruby-forum.com/t/give-focus-to-an-input-field-of-a-form/113441 "2007-08-31T11:29:57Z")

</div>

Hi, I am new to rails and I have setup Typo on my site. One little thing bugs me, the login page doesn’t give focus to the “user\_login” field. I was wondering what do I need to do to make rails help with this? I h…

---

## [RoR on Fedora 7](https://www.ruby-forum.com/t/ror-on-fedora-7/113462)

<div class="topic-metadata">

**Author:** [@Chuob.Sok](https://www.ruby-forum.com/u/Chuob.Sok)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 11:11am UTC](https://www.ruby-forum.com/t/ror-on-fedora-7/113462 "2007-08-31T11:11:56Z")

</div>

Dear All, I have configured to run my application of Ruby on Rail on Fedora 7. Actually, It is working well on localhost (Linux Fedora7). But I don’t know how to configure to run that application via the network. I …

---

## [RoR on Fedora 7](https://www.ruby-forum.com/t/ror-on-fedora-7/113459)

<div class="topic-metadata">

**Author:** [@chuobsok](https://www.ruby-forum.com/u/chuobsok)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 10:31am UTC](https://www.ruby-forum.com/t/ror-on-fedora-7/113459 "2007-08-31T10:31:28Z")

</div>

Dear All, I have configured to run my application of Ruby on Rail on Fedora 7. Actually, It is working well on localhost (Linux Fedora7). But I don’t know how to configure to run that application via the network. I m…

---

## [Is rails caching my date](https://www.ruby-forum.com/t/is-rails-caching-my-date/113448)

<div class="topic-metadata">

**Author:** [@yannimac](https://www.ruby-forum.com/u/yannimac)\
**Replies:** 1\
**Last updated:** [August 31, 2007, 10:08am UTC](https://www.ruby-forum.com/t/is-rails-caching-my-date/113448 "2007-08-31T10:08:48Z")

</div>

I have an app that is supposed to expire items based on a comparison of the expiration date of the item and the current date. So if expiration date \< current date, I do not want to display the item. Rails seems to b…

---

## [User blogging and discussions](https://www.ruby-forum.com/t/user-blogging-and-discussions/113458)

<div class="topic-metadata">

**Author:** [@gsampathkumar](https://www.ruby-forum.com/u/gsampathkumar)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 10:04am UTC](https://www.ruby-forum.com/t/user-blogging-and-discussions/113458 "2007-08-31T10:04:48Z")

</div>

Hi, I’m in the process of building a website using RoR and would like to add the capability to allow registered users of my website create personal blogs on my site as well as start/participate in discussions (discus…

---

## [Is this common](https://www.ruby-forum.com/t/is-this-common/113408)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 5\
**Last updated:** [August 31, 2007, 8:21am UTC](https://www.ruby-forum.com/t/is-this-common/113408 "2007-08-31T08:21:35Z")

</div>

Hi, I have a webapp built using ruby on rails. The login page takes the username and password. When I run the application and check the development.log file I see the passwords in that file in text format of users lo…

---

## [Cygwin RoR + Windows MySQL Binary == nil](https://www.ruby-forum.com/t/cygwin-ror-windows-mysql-binary-nil/112485)

<div class="topic-metadata">

**Author:** [@dcloutman](https://www.ruby-forum.com/u/dcloutman)\
**Replies:** 3\
**Last updated:** [August 31, 2007, 7:53am UTC](https://www.ruby-forum.com/t/cygwin-ror-windows-mysql-binary-nil/112485 "2007-08-31T07:53:32Z")

</div>

Hi folks. I’m just learning RoR, and I’m trying to get my development environment up and running on my Windows machine. I am working through Patrik Lenz’s book from Sitepoint, but am getting stuck because of the esote…

---

## [Flash\[:notice\] as coach content](https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423)

<div class="topic-metadata">

**Author:** [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Replies:** 2\
**Last updated:** [August 31, 2007, 5:51am UTC](https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423 "2007-08-31T05:51:26Z")

</div>

Hi, I would like to use flash\[:notice\] to display coach content, e.g. “It’s generally a bad idea to do \[whatever you just did\]. Click here to find out why” - which goes to a more complete coaching page on that topic…

---

## [Querying an unrelated table](https://www.ruby-forum.com/t/querying-an-unrelated-table/113436)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 4\
**Last updated:** [August 31, 2007, 4:34am UTC](https://www.ruby-forum.com/t/querying-an-unrelated-table/113436 "2007-08-31T04:34:22Z")

</div>

I have three tables: Case, Attorney and Firm. Case belongs to Attorney and Attorney Belongs to Firm. I don’t see how I can define that Case belongs to Firm through Attorney since Attorney is not a join table (does not…

---

## [US states and world countries selectors](https://www.ruby-forum.com/t/us-states-and-world-countries-selectors/113442)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 1\
**Last updated:** [August 31, 2007, 4:28am UTC](https://www.ruby-forum.com/t/us-states-and-world-countries-selectors/113442 "2007-08-31T04:28:22Z")

</div>

Hello all! I was just wondering, I need to build a signup form with US states and also world countries selector. Is there already a helper os something that implements or makes it easier to implement this for Rails (…

---

## [Has/belongs to many sql error](https://www.ruby-forum.com/t/has-belongs-to-many-sql-error/113414)

<div class="topic-metadata">

**Author:** [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Replies:** 3\
**Last updated:** [August 31, 2007, 4:20am UTC](https://www.ruby-forum.com/t/has-belongs-to-many-sql-error/113414 "2007-08-31T04:20:03Z")

</div>

I have a model Asset which has\_and\_belongs\_to\_many :tags. Tag has only one field, name. There is a table assets\_tags which only has an asset\_id and a tag\_id. I can add a tag to one asset. If I try to add the same t…

---

## [Strange acts\_as\_authenticated code in account/index action](https://www.ruby-forum.com/t/strange-acts-as-authenticated-code-in-account-index-action/113445)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 4:07am UTC](https://www.ruby-forum.com/t/strange-acts-as-authenticated-code-in-account-index-action/113445 "2007-08-31T04:07:20Z")

</div>

Hello, I’m using the acts\_as\_authenticated plugin. I have not yet modified the AccountController much. All the default actions are still there untouched. Then, I noted a strange behaviour: When the user is not logged…

---

## [Specifying Find Conditions on Multiple Tables](https://www.ruby-forum.com/t/specifying-find-conditions-on-multiple-tables/113335)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 16\
**Last updated:** [August 31, 2007, 4:07am UTC](https://www.ruby-forum.com/t/specifying-find-conditions-on-multiple-tables/113335 "2007-08-31T04:07:20Z")

</div>

Hello, I have two database tables, one called users and one called user\_info. Every user has one record in user\_info, so I use “has\_one :user\_info” in the user model and “belongs\_to :users” in the user\_info model. Wha…

---

## [Using a Model in a rake task?](https://www.ruby-forum.com/t/using-a-model-in-a-rake-task/113438)

<div class="topic-metadata">

**Author:** [@chirag](https://www.ruby-forum.com/u/chirag)\
**Replies:** 1\
**Last updated:** [August 31, 2007, 2:07am UTC](https://www.ruby-forum.com/t/using-a-model-in-a-rake-task/113438 "2007-08-31T02:07:49Z")

</div>

I’'m trying to use a model in a Rake task like this: require ‘time’ namespace :halo do desc "post to the usertable via " task :post\_user\_with\_activerecord do end\_time = Time.new start\_time = end\_time - 60 until st…

---

## [Open source web apps with Rails](https://www.ruby-forum.com/t/open-source-web-apps-with-rails/113398)

<div class="topic-metadata">

**Author:** [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Replies:** 1\
**Last updated:** [August 31, 2007, 1:32am UTC](https://www.ruby-forum.com/t/open-source-web-apps-with-rails/113398 "2007-08-31T01:32:08Z")

</div>

Does anyone know of any good open source website packages for Rails? I’m looking for several of the following to compare for a couple of business ideas: Blog Engine Community site (with forums) Social News site (lik…

---

## [Audit tables?](https://www.ruby-forum.com/t/audit-tables/113425)

<div class="topic-metadata">

**Author:** [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Replies:** 5\
**Last updated:** [August 31, 2007, 1:25am UTC](https://www.ruby-forum.com/t/audit-tables/113425 "2007-08-31T01:25:08Z")

</div>

Hi, I would like to create audit tables in my RoR/mysql app. I would like to start out auditing just about everything: every change in the database should result in a row in (one or more) audit tables. My app requ…

---

## [What I found out about nginx](https://www.ruby-forum.com/t/what-i-found-out-about-nginx/113286)

<div class="topic-metadata">

**Author:** [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Replies:** 5\
**Last updated:** [August 31, 2007, 12:40am UTC](https://www.ruby-forum.com/t/what-i-found-out-about-nginx/113286 "2007-08-31T00:40:38Z")

</div>

Hi! I played around with it a little bit and found out the following: server\_name in a vhost entry doesn’t really guarantee that only requests coming from specified domain will get served by that vhost. For example (…

---

## [Parent child relationships and searching](https://www.ruby-forum.com/t/parent-child-relationships-and-searching/113426)

<div class="topic-metadata">

**Author:** [@wonko](https://www.ruby-forum.com/u/wonko)\
**Replies:** 0\
**Last updated:** [August 31, 2007, 12:00am UTC](https://www.ruby-forum.com/t/parent-child-relationships-and-searching/113426 "2007-08-31T00:00:04Z")

</div>

I have a parent model object called team, and a child model called team\_aliases. Like this: create\_table teams do |t| t.column :name, :string end create\_table team\_aliases do |t| t.column :team\_id, :integer t.colu…

---

## [Best way to setup this relationship in activerecord](https://www.ruby-forum.com/t/best-way-to-setup-this-relationship-in-activerecord/113346)

<div class="topic-metadata">

**Author:** [@xgamerx](https://www.ruby-forum.com/u/xgamerx)\
**Replies:** 2\
**Last updated:** [August 30, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/best-way-to-setup-this-relationship-in-activerecord/113346 "2007-08-30T23:47:30Z")

</div>

Hello guys, I am starting a new project and I am relatively inexperienced with Database design. I would absolutely love some guidance on the best way to setup a certain relationship in ActiveRecord. I am created a se…

---

## [Alias\_method\_chain stack level too deep in Rake test only](https://www.ruby-forum.com/t/alias-method-chain-stack-level-too-deep-in-rake-test-only/113424)

<div class="topic-metadata">

**Author:** [@gcnovus](https://www.ruby-forum.com/u/gcnovus)\
**Replies:** 1\
**Last updated:** [August 30, 2007, 11:33pm UTC](https://www.ruby-forum.com/t/alias-method-chain-stack-level-too-deep-in-rake-test-only/113424 "2007-08-30T23:33:58Z")

</div>

I have an odd error. I have the following module: module ActionController module SslSupport def self.included(base) raise "#{base} does not define url\_for" unless base.method\_defined?(:url\_for) unless base.respon…

---

## [Simple question for composed\_of](https://www.ruby-forum.com/t/simple-question-for-composed-of/112549)

<div class="topic-metadata">

**Author:** [@dparkmit](https://www.ruby-forum.com/u/dparkmit)\
**Replies:** 1\
**Last updated:** [August 30, 2007, 11:26pm UTC](https://www.ruby-forum.com/t/simple-question-for-composed-of/112549 "2007-08-30T23:26:56Z")

</div>

Hi All, Here’s a n00b question for composed\_of. In what file do you put the class that is used for the composed\_of? For example, let’s say that you have the code below: class Declaration \< ActiveRecord::Base compo…

---

## [Problem with data migration and acts\_as\_tree](https://www.ruby-forum.com/t/problem-with-data-migration-and-acts-as-tree/113421)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [August 30, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/problem-with-data-migration-and-acts-as-tree/113421 "2007-08-30T23:08:54Z")

</div>

Hi, this is my first post here, my name is Lucas and I’m just starting with rails. For one of the first models I made (an accounts plan), I had some example data in a CSV file, so I created this migration, the idea is …

---

## [Can you spot the SQL syntax error?](https://www.ruby-forum.com/t/can-you-spot-the-sql-syntax-error/113418)

<div class="topic-metadata">

**Author:** [@LAB](https://www.ruby-forum.com/u/LAB)\
**Replies:** 3\
**Last updated:** [August 30, 2007, 10:58pm UTC](https://www.ruby-forum.com/t/can-you-spot-the-sql-syntax-error/113418 "2007-08-30T22:58:53Z")

</div>

In my controller neighborMatches I have an array of ids: neighborMatches = neighborMatches.map!{|n| n.id} I want to find all the properties that match some conditions, and is also in this list of ids: @properties = P…

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

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