# Rails

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

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

---

## [Does the option :host work in link\_to?](https://www.ruby-forum.com/t/does-the-option-host-work-in-link-to/105278)

<div class="topic-metadata">

**Author:** [@Shiwei](https://www.ruby-forum.com/u/Shiwei)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/does-the-option-host-work-in-link-to/105278 "2007-05-28T17:08:36Z")

</div>

Hi, I used the following code line in a View file on machine http://xx.test.com:7777: \<%= link\_to “GoToAnotherHost”, { :protocol =\> “http”, :host =\> “app1books.test.com:7777”, :controller =\> “admin”, :action =\> “list…

---

## [Function Testing](https://www.ruby-forum.com/t/function-testing/105272)

<div class="topic-metadata">

**Author:** [@gousi](https://www.ruby-forum.com/u/gousi)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/function-testing/105272 "2007-05-28T17:05:36Z")

</div>

hi, First how to start the function testing in rails…

---

## [Globalize: not visible changes made to translations](https://www.ruby-forum.com/t/globalize-not-visible-changes-made-to-translations/105299)

<div class="topic-metadata">

**Author:** [@tom](https://www.ruby-forum.com/u/tom)\
**Replies:** 0\
**Last updated:** [May 28, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/globalize-not-visible-changes-made-to-translations/105299 "2007-05-28T17:03:26Z")

</div>

Hi, I’m using Globalize in my rails app and when I insert the translation for the first time everything is ok, but after that, any changes made to that translation are not visible in my views. They become available wh…

---

## [Scaffold and foreign keys](https://www.ruby-forum.com/t/scaffold-and-foreign-keys/136512)

<div class="topic-metadata">

**Author:** [@phirefly](https://www.ruby-forum.com/u/phirefly)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/scaffold-and-foreign-keys/136512 "2007-05-28T16:58:35Z")

</div>

Hello, I create a migration to add a foreign key ‘page\_id’ to a table ‘main\_sections’. After running the migration and adding the column, the scaffol that I have on the main\_setions table does not add the foreign key…

---

## [Help with modelling ActiveRecord associations](https://www.ruby-forum.com/t/help-with-modelling-activerecord-associations/105297)

<div class="topic-metadata">

**Author:** [@croxmeister](https://www.ruby-forum.com/u/croxmeister)\
**Replies:** 0\
**Last updated:** [May 28, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/help-with-modelling-activerecord-associations/105297 "2007-05-28T16:45:34Z")

</div>

I have been messing about with Rails and ActiveRecord for a while now, and I have had great success in the simple cases. But I have hit a stumbling block when it came to modelling a non-trivial problem domain. I had …

---

## [Transaction error doesn't throw exception?](https://www.ruby-forum.com/t/transaction-error-doesnt-throw-exception/105172)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 4:25pm UTC](https://www.ruby-forum.com/t/transaction-error-doesnt-throw-exception/105172 "2007-05-28T16:25:14Z")

</div>

I need to save 3 kinds of records in one transaction and throw an exception if one error occurs in any one of the models : User -\>\> Proposal -\>\> Rating I wrote in my controller : … user = User.new(…) begin User.…

---

## [How to use linux commands in ruby?](https://www.ruby-forum.com/t/how-to-use-linux-commands-in-ruby/105294)

<div class="topic-metadata">

**Author:** [@selvaraj](https://www.ruby-forum.com/u/selvaraj)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/how-to-use-linux-commands-in-ruby/105294 "2007-05-28T16:19:31Z")

</div>

Hi I try to use ‘at’ command in ruby file. I am not able to do this. basically I want to run adhoc scheduling in my application.

---

## [Trouble installing/configuring RadRails on XP](https://www.ruby-forum.com/t/trouble-installing-configuring-radrails-on-xp/105241)

<div class="topic-metadata">

**Author:** [@r.g](https://www.ruby-forum.com/u/r.g)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 3:53pm UTC](https://www.ruby-forum.com/t/trouble-installing-configuring-radrails-on-xp/105241 "2007-05-28T15:53:27Z")

</div>

Hello, (I apologize if this isn’t the right place to post this.) I’m trying to get RadRails up and running on Eclipse 3.2 on Windows XP. I followed the instructions at \<Aptana.com | Axway Integrating\_RadRails\_with\_A…

---

## [\#rubyonrails group discussion at RailsConf](https://www.ruby-forum.com/t/rubyonrails-group-discussion-at-railsconf/105296)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 28, 2007, 3:48pm UTC](https://www.ruby-forum.com/t/rubyonrails-group-discussion-at-railsconf/105296 "2007-05-28T15:48:26Z")

</div>

If you’re new to Rails or have ever had limited success chatting in the #rubyonrails channel over at irc.freenode.net like I have, have a listen to a recently posted group discussion that took place at RailsConf. htt…

---

## [Storing large BLOBs in the database with ActiveRecord](https://www.ruby-forum.com/t/storing-large-blobs-in-the-database-with-activerecord/105122)

<div class="topic-metadata">

**Author:** [@mrnice](https://www.ruby-forum.com/u/mrnice)\
**Replies:** 7\
**Last updated:** [May 28, 2007, 3:29pm UTC](https://www.ruby-forum.com/t/storing-large-blobs-in-the-database-with-activerecord/105122 "2007-05-28T15:29:44Z")

</div>

I have a model called Product with an attribute called file of type :binary (DB BLOB). If I do product.save (where product is an instance of my Product model), here is SQL statement that the mysql adapter for Ruby wi…

---

## [Out-cheat validates\_uniqueness\_of](https://www.ruby-forum.com/t/out-cheat-validates-uniqueness-of/105293)

<div class="topic-metadata">

**Author:** [@jochen\_kaechelin](https://www.ruby-forum.com/u/jochen_kaechelin)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/out-cheat-validates-uniqueness-of/105293 "2007-05-28T15:20:22Z")

</div>

before\_save :strip\_strings validates\_uniqueness\_of :username validates\_presence\_of :username private def strip\_strings self.username = username.gsub!(" ","") end example: username = " removed\_email\_addr…

---

## [Rails Server Issues](https://www.ruby-forum.com/t/rails-server-issues/105217)

<div class="topic-metadata">

**Author:** [@Zach\_ISSS\_LT3media](https://www.ruby-forum.com/u/Zach_ISSS_LT3media)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 3:18pm UTC](https://www.ruby-forum.com/t/rails-server-issues/105217 "2007-05-28T15:18:22Z")

</div>

=\> Booting Mongrel (use ‘script/server webrick’ to force WEBrick) =\> Rails application starting on http://0.0.0.0:1337 =\> Call with -d to detach =\> Ctrl-C to shutdown server \*\* Starting Mongrel listening at 0.0.0.0:1…

---

## [Nil objects that are not nil elsewhere in same scope](https://www.ruby-forum.com/t/nil-objects-that-are-not-nil-elsewhere-in-same-scope/105291)

<div class="topic-metadata">

**Author:** [@Dion\_H](https://www.ruby-forum.com/u/Dion_H)\
**Replies:** 4\
**Last updated:** [May 28, 2007, 3:11pm UTC](https://www.ruby-forum.com/t/nil-objects-that-are-not-nil-elsewhere-in-same-scope/105291 "2007-05-28T15:11:47Z")

</div>

hi there how can an object be nil in line 37 but not nil in lines 34 & 40??? Parameters: {“activity\_id”=\>“7”, “action”=\>“show”, “id”=\>“15”, “controller”=\>“photos”} User Columns (0.016000) SHOW FIELDS FROM users Us…

---

## [How to add an event directly to a web calendar](https://www.ruby-forum.com/t/how-to-add-an-event-directly-to-a-web-calendar/105250)

<div class="topic-metadata">

**Author:** [@codecarpenter](https://www.ruby-forum.com/u/codecarpenter)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 2:38pm UTC](https://www.ruby-forum.com/t/how-to-add-an-event-directly-to-a-web-calendar/105250 "2007-05-28T14:38:17Z")

</div>

I don’t really have a good idea conceptually of how to add an event a user selected to a web calendar such as Google C. without first generate a .ics (iCal) file and then import it manually to the calendar application…

---

## [MySQL Order By Association Size](https://www.ruby-forum.com/t/mysql-order-by-association-size/105284)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/mysql-order-by-association-size/105284 "2007-05-28T14:13:12Z")

</div>

Is it possible to write this query (or some other query that does essentially the same) using just ActiveRecord.find? SELECT posts.title, COUNT(comments.id) FROM posts, comments WHERE posts.id = comments.post\_id GROUP…

---

## [Check box value in array](https://www.ruby-forum.com/t/check-box-value-in-array/105063)

<div class="topic-metadata">

**Author:** [@amin](https://www.ruby-forum.com/u/amin)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 2:01pm UTC](https://www.ruby-forum.com/t/check-box-value-in-array/105063 "2007-05-28T14:01:11Z")

</div>

Hi guys, I have a group of check box in rails page. check box Code as below: \<% for count in @total\_cellno %\> \<% end %\> I want to receive the selected value in my controller model. @selected\_box \<\< params\[“checkb…

---

## [List all available nested resources routes?](https://www.ruby-forum.com/t/list-all-available-nested-resources-routes/105255)

<div class="topic-metadata">

**Author:** [@Dion\_H](https://www.ruby-forum.com/u/Dion_H)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/list-all-available-nested-resources-routes/105255 "2007-05-28T13:45:10Z")

</div>

hi there, how do you list all the possible named routes for your nested resources is there a way to do this from console??? cheers dion

---

## [Url detection](https://www.ruby-forum.com/t/url-detection/105125)

<div class="topic-metadata">

**Author:** [@comike01](https://www.ruby-forum.com/u/comike01)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 1:44pm UTC](https://www.ruby-forum.com/t/url-detection/105125 "2007-05-28T13:44:09Z")

</div>

Kind of new with rails, but is there a simple way to detect a sites URL? thanks.

---

## [Problem with validates\_uniqueness\_of and error\_messages\_on](https://www.ruby-forum.com/t/problem-with-validates-uniqueness-of-and-error-messages-on/105227)

<div class="topic-metadata">

**Author:** [@jochen\_kaechelin](https://www.ruby-forum.com/u/jochen_kaechelin)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 12:49pm UTC](https://www.ruby-forum.com/t/problem-with-validates-uniqueness-of-and-error-messages-on/105227 "2007-05-28T12:49:59Z")

</div>

I did not get an output frpm “error\_messages\_for” but “validates\_uniqueness\_of” just works fine - I’am not able to store duplicate values for username - exactly what I want to have. Model model.rb: class Member \< Acti…

---

## [Response.End / Exit equivalent in Rails?](https://www.ruby-forum.com/t/response-end-exit-equivalent-in-rails/136596)

<div class="topic-metadata">

**Author:** [@yeago](https://www.ruby-forum.com/u/yeago)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 12:42pm UTC](https://www.ruby-forum.com/t/response-end-exit-equivalent-in-rails/136596 "2007-05-28T12:42:58Z")

</div>

If the user types in junk, I’d like to return the user to the original page. Can’t seem to do it. How is this typically handled? def getBody url begin open(url) do |file| @body = file.read end rescue SystemCallEr…

---

## [Dynamic drop down - pls help](https://www.ruby-forum.com/t/dynamic-drop-down-pls-help/105267)

<div class="topic-metadata">

**Author:** [@anusha18](https://www.ruby-forum.com/u/anusha18)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 12:15pm UTC](https://www.ruby-forum.com/t/dynamic-drop-down-pls-help/105267 "2007-05-28T12:15:56Z")

</div>

002\_create\_states.rb class CreateCities \< ActiveRecord::Migration def self.up create\_table :cities do |t| t.column :state\_id, :integer t.column :city\_name, :string end end def self.down drop\_table :cities end …

---

## [Problem creating SVN repository](https://www.ruby-forum.com/t/problem-creating-svn-repository/105261)

<div class="topic-metadata">

**Author:** [@darrenevans](https://www.ruby-forum.com/u/darrenevans)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 11:58am UTC](https://www.ruby-forum.com/t/problem-creating-svn-repository/105261 "2007-05-28T11:58:53Z")

</div>

When I try to create the initial repository using RoR I get the following error: Couldn't open a repository svn: Unable to open an ra\_local session to URL svn: Unable to open repository ‘file:///c::/repository/schulj…

---

## [Helper with block compile error](https://www.ruby-forum.com/t/helper-with-block-compile-error/105264)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 11:37am UTC](https://www.ruby-forum.com/t/helper-with-block-compile-error/105264 "2007-05-28T11:37:51Z")

</div>

HI, i’m trying to write a helper that replaces link\_to\_remote that accepts a block but it gets a compile error in the template: I don’t know what I’m doing wrong… TIA application\_helper.rb def link\_block\_to\_remote( o…

---

## [Spawn the fastCGI process](https://www.ruby-forum.com/t/spawn-the-fastcgi-process/105277)

<div class="topic-metadata">

**Author:** [@ziggy](https://www.ruby-forum.com/u/ziggy)\
**Replies:** 0\
**Last updated:** [May 28, 2007, 11:21am UTC](https://www.ruby-forum.com/t/spawn-the-fastcgi-process/105277 "2007-05-28T11:21:47Z")

</div>

I need to spawn the FastCGI process somehow. The purpose in the following: i have some time-consuming requests and 2 fcgi process normally. When such time-consuming request comes, it occupies the fastcgi process compl…

---

## [Polymorphic Associations - Error-Handling?](https://www.ruby-forum.com/t/polymorphic-associations-error-handling/105276)

<div class="topic-metadata">

**Author:** [@scope](https://www.ruby-forum.com/u/scope)\
**Replies:** 0\
**Last updated:** [May 28, 2007, 11:17am UTC](https://www.ruby-forum.com/t/polymorphic-associations-error-handling/105276 "2007-05-28T11:17:03Z")

</div>

Hey there, I have used polymorphic associations to model different types of questions (multiple choice, simple text, etc.) I want to allow users to create these questions and chose a type to enter the specific data ( …

---

## [Check\_box\_tag or check\_box which is fit for that?](https://www.ruby-forum.com/t/check-box-tag-or-check-box-which-is-fit-for-that/105259)

<div class="topic-metadata">

**Author:** [@ichikawa](https://www.ruby-forum.com/u/ichikawa)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 10:37am UTC](https://www.ruby-forum.com/t/check-box-tag-or-check-box-which-is-fit-for-that/105259 "2007-05-28T10:37:45Z")

</div>

hi, When I use \<% for count in @total\_cellno %\> \<%= check\_box\_tag(“checkbox”, value = count, checked = false) %\> \<% end %\> It produce the html . . . And controller model @total \<\< params\[:checkbox\] but the…

---

## [Problem in connecting Rails to MS SQL Server 2000](https://www.ruby-forum.com/t/problem-in-connecting-rails-to-ms-sql-server-2000/105269)

<div class="topic-metadata">

**Author:** [@paragados](https://www.ruby-forum.com/u/paragados)\
**Replies:** 0\
**Last updated:** [May 28, 2007, 10:10am UTC](https://www.ruby-forum.com/t/problem-in-connecting-rails-to-ms-sql-server-2000/105269 "2007-05-28T10:10:04Z")

</div>

Hello, Imâ€™ new to Ruby and Rails. I had trouble in connecting to database. I used MS SQL Server 2000. I had follow the instructions in conncecting in some site tutorial however when I run my web application I get th…

---

## [Mac setup issue](https://www.ruby-forum.com/t/mac-setup-issue/105237)

<div class="topic-metadata">

**Author:** [@MichaelLatta](https://www.ruby-forum.com/u/MichaelLatta)\
**Replies:** 3\
**Last updated:** [May 28, 2007, 8:17am UTC](https://www.ruby-forum.com/t/mac-setup-issue/105237 "2007-05-28T08:17:34Z")

</div>

I just installed an updated set of tools (ruby, rails, etc) under my home directory for my mac 10.4, since I did not want to disturb the pre-installed environment in case something in the system relies on that. The p…

---

## [POSTing to a different website in a controller action](https://www.ruby-forum.com/t/posting-to-a-different-website-in-a-controller-action/105251)

<div class="topic-metadata">

**Author:** [@scott](https://www.ruby-forum.com/u/scott)\
**Replies:** 1\
**Last updated:** [May 28, 2007, 4:54am UTC](https://www.ruby-forum.com/t/posting-to-a-different-website-in-a-controller-action/105251 "2007-05-28T04:54:25Z")

</div>

I have a page that has form that I want to submit to one of my actions. However, inside of the action, I want to post to a different website and have the browser go to that website. The code I found on the groups seem…

---

## [REST and special URLs](https://www.ruby-forum.com/t/rest-and-special-urls/105230)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 2\
**Last updated:** [May 28, 2007, 4:44am UTC](https://www.ruby-forum.com/t/rest-and-special-urls/105230 "2007-05-28T04:44:57Z")

</div>

Hi all, I want to start using some REST in my design. I have build a restfull controller and try to link to it in my view. The problem is that my URLs all have something extra added (a session value). When I use the …

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

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