# Rails

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

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

---

## [Destroying entities related by foreign key](https://www.ruby-forum.com/t/destroying-entities-related-by-foreign-key/161903)

<div class="topic-metadata">

**Author:** [@pesho318i](https://www.ruby-forum.com/u/pesho318i)\
**Replies:** 3\
**Last updated:** [March 3, 2009, 5:53pm UTC](https://www.ruby-forum.com/t/destroying-entities-related-by-foreign-key/161903 "2009-03-03T17:53:51Z")

</div>

hi all, I have a table “memberships”. It has a field user\_id, which I want to use as a foreign key to the “users” table. So, as far as I get it, in the membership model I have to write: has\_many :users In the users …

---

## [Save as new?](https://www.ruby-forum.com/t/save-as-new/161901)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 1\
**Last updated:** [March 3, 2009, 4:56pm UTC](https://www.ruby-forum.com/t/save-as-new/161901 "2009-03-03T16:56:52Z")

</div>

@row = Post.find(5) How can I save it as a new row? Post.new(@row) ?? Do I need to destroy an old id?

---

## [Link\_to\_remote : render a view](https://www.ruby-forum.com/t/link-to-remote-render-a-view/161890)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 3\
**Last updated:** [March 3, 2009, 2:51pm UTC](https://www.ruby-forum.com/t/link-to-remote-render-a-view/161890 "2009-03-03T14:51:09Z")

</div>

when a user clicks on a link\_to\_remote I would like to it to render a view that i already have established. I know about page.redirect\_to but that would force a refresh. Id like to do something like page.replace “an\_e…

---

## [REST wsdl & Wavemaker](https://www.ruby-forum.com/t/rest-wsdl-wavemaker/129415)

<div class="topic-metadata">

**Author:** [@terhorst](https://www.ruby-forum.com/u/terhorst)\
**Replies:** 1\
**Last updated:** [March 3, 2009, 2:34pm UTC](https://www.ruby-forum.com/t/rest-wsdl-wavemaker/129415 "2009-03-03T14:34:37Z")

</div>

I’m currently investigating creating a Rails application that will offer a set of services for consumption by Wavemaker (used to be ActiveGrid) which is a front-end builder. Wavemaker is supposed to be able to consume…

---

## [Storing encrypted strings in MYSQL - encrypted data changes on DB store](https://www.ruby-forum.com/t/storing-encrypted-strings-in-mysql-encrypted-data-changes-on-db-store/161881)

<div class="topic-metadata">

**Author:** [@ram](https://www.ruby-forum.com/u/ram)\
**Replies:** 4\
**Last updated:** [March 3, 2009, 1:02pm UTC](https://www.ruby-forum.com/t/storing-encrypted-strings-in-mysql-encrypted-data-changes-on-db-store/161881 "2009-03-03T13:02:40Z")

</div>

Im trying to encrypt a string and store it in the DB. But there seems to be some interpretation problems both in Ruby and in MySQL. Here’s what Ive tried and the results… (the data to be encrypted is the string “12318…

---

## [Empty file on upload](https://www.ruby-forum.com/t/empty-file-on-upload/161788)

<div class="topic-metadata">

**Author:** [@norricorp](https://www.ruby-forum.com/u/norricorp)\
**Replies:** 3\
**Last updated:** [March 3, 2009, 12:53pm UTC](https://www.ruby-forum.com/t/empty-file-on-upload/161788 "2009-03-03T12:53:48Z")

</div>

Uploading image via web page. Create the new file but file is zero length. Any ideas where I am going wrong?

---

## [Form\_remote\_tag](https://www.ruby-forum.com/t/form-remote-tag/161430)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 3\
**Last updated:** [March 3, 2009, 12:04pm UTC](https://www.ruby-forum.com/t/form-remote-tag/161430 "2009-03-03T12:04:20Z")

</div>

i cant figure out how my syntax is wrong. Ive looked at various apis but they dotn give examples using paths but a book im using does for a simple case. Whats wrong with this \<% form\_remote\_tag :url =\> multi\_complete…

---

## [Give own domains to users (shopify like)](https://www.ruby-forum.com/t/give-own-domains-to-users-shopify-like/161793)

<div class="topic-metadata">

**Author:** [@mix](https://www.ruby-forum.com/u/mix)\
**Replies:** 7\
**Last updated:** [March 3, 2009, 11:56am UTC](https://www.ruby-forum.com/t/give-own-domains-to-users-shopify-like/161793 "2009-03-03T11:56:40Z")

</div>

Hi, do you have any hint on how give to users the possibility to set an own domain instead of using a subdomain of the app? The best example i’ve found is how shopify works, they permit to have the shop under shopname…

---

## [Validation - set focus](https://www.ruby-forum.com/t/validation-set-focus/161859)

<div class="topic-metadata">

**Author:** [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Replies:** 6\
**Last updated:** [March 3, 2009, 9:38am UTC](https://www.ruby-forum.com/t/validation-set-focus/161859 "2009-03-03T09:38:22Z")

</div>

hi, Is there any way to set focus in a particular field, after validation in rails?? or we have to use only javascript. For example., validates\_presence\_of :username (assume there is no username given) after valid…

---

## [No method error - nil object](https://www.ruby-forum.com/t/no-method-error-nil-object/161864)

<div class="topic-metadata">

**Author:** [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Replies:** 4\
**Last updated:** [March 3, 2009, 9:11am UTC](https://www.ruby-forum.com/t/no-method-error-nil-object/161864 "2009-03-03T09:11:57Z")

</div>

I am getting following error: ################################################## NoMethodError in TopicsController#show You have a nil object when you didn’t expect it! The error occurred while evaluating nil.items …

---

## [Setting value of a indexed property of an OLE object](https://www.ruby-forum.com/t/setting-value-of-a-indexed-property-of-an-ole-object/161869)

<div class="topic-metadata">

**Author:** [@Seyit\_Caglar\_Abbaso](https://www.ruby-forum.com/u/Seyit_Caglar_Abbaso)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 9:07am UTC](https://www.ruby-forum.com/t/setting-value-of-a-indexed-property-of-an-ole-object/161869 "2009-03-03T09:07:50Z")

</div>

I suspect this question is not directly related by Rails but perhaps Ruby users on this list know an answer for this I have an OLE object which has an indexed property on it (something like a dictionary). In C# (or…

---

## [How to use Wsdl2ruby generated files](https://www.ruby-forum.com/t/how-to-use-wsdl2ruby-generated-files/161867)

<div class="topic-metadata">

**Author:** [@wanyixue](https://www.ruby-forum.com/u/wanyixue)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 8:51am UTC](https://www.ruby-forum.com/t/how-to-use-wsdl2ruby-generated-files/161867 "2009-03-03T08:51:00Z")

</div>

i am cloning a current soap server to ruby and i have zero experience in this soap thing. i did a wsdl2ruby on the url and generated 3 riles DriverDataServiceMappingRegistry.rb DriverDataService.rb DriverServiceServ…

---

## [Validates problem](https://www.ruby-forum.com/t/validates-problem/161771)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 5\
**Last updated:** [March 3, 2009, 6:43am UTC](https://www.ruby-forum.com/t/validates-problem/161771 "2009-03-03T06:43:55Z")

</div>

Validation: validates\_presence\_of :name validates\_length\_of :name, :maximum =\> 150 validates\_inclusion\_of :category, :in =\> %w( X Y XY ) validates\_length\_of :gender, :maximum =\> 3 validates\_length\_of :tag, :within …

---

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

<div class="topic-metadata">

**Author:** [@tanker](https://www.ruby-forum.com/u/tanker)\
**Replies:** 1\
**Last updated:** [March 3, 2009, 6:41am UTC](https://www.ruby-forum.com/t/actionmailer/161792 "2009-03-03T06:41:30Z")

</div>

i have this in my mdel infomailer.rb class Infomailer \< ActionMailer::Base helper :application end but i can’t understand why i can’t use method defined i application\_helper.rb in template app/views/infomailer/send…

---

## [\[JOBS\] Early stage political startup looking for advanced rubyist and/or designer](https://www.ruby-forum.com/t/jobs-early-stage-political-startup-looking-for-advanced-rubyist-and-or-designer/196907)

<div class="topic-metadata">

**Author:** [@marclafia](https://www.ruby-forum.com/u/marclafia)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 6:39am UTC](https://www.ruby-forum.com/t/jobs-early-stage-political-startup-looking-for-advanced-rubyist-and-or-designer/196907 "2009-03-03T06:39:01Z")

</div>

This is a shot out in the dark, but I figured it’s worth a try…especially in this job market. :slight\_smile: My friend and I are in the very early planning stages of a startup that will be politically focused. We int…

---

## [Job Posting - Early stage political startup looking for advanced rubyist and/or designer](https://www.ruby-forum.com/t/job-posting-early-stage-political-startup-looking-for-advanced-rubyist-and-or-designer/161861)

<div class="topic-metadata">

**Author:** [@marclafia](https://www.ruby-forum.com/u/marclafia)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 6:37am UTC](https://www.ruby-forum.com/t/job-posting-early-stage-political-startup-looking-for-advanced-rubyist-and-or-designer/161861 "2009-03-03T06:37:16Z")

</div>

This is a shot out in the dark, but I figured it’s worth a try…especially in this job market. :slight\_smile: My friend and I are in the very early planning stages of a startup that will be politically focused. We int…

---

## [Autocomplete on edit](https://www.ruby-forum.com/t/autocomplete-on-edit/161849)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 1\
**Last updated:** [March 3, 2009, 5:45am UTC](https://www.ruby-forum.com/t/autocomplete-on-edit/161849 "2009-03-03T05:45:07Z")

</div>

Is the normal autocomplete supposed to pull from the DB what is in the field when doing an edit or is there something else that needs to be done to get it to show up while doing an edit?

---

## [Catch the browser close event](https://www.ruby-forum.com/t/catch-the-browser-close-event/161809)

<div class="topic-metadata">

**Author:** [@hiro](https://www.ruby-forum.com/u/hiro)\
**Replies:** 13\
**Last updated:** [March 3, 2009, 5:18am UTC](https://www.ruby-forum.com/t/catch-the-browser-close-event/161809 "2009-03-03T05:18:49Z")

</div>

Hi everybody, I’m pretty new in rails so I’ve been “playing” programming simple app one of the was an app with a login and session management. Up to here, everything is pretty smooth, as rails; but I have a question t…

---

## [Javascript file structure](https://www.ruby-forum.com/t/javascript-file-structure/161853)

<div class="topic-metadata">

**Author:** [@vladimirprieto](https://www.ruby-forum.com/u/vladimirprieto)\
**Replies:** 2\
**Last updated:** [March 3, 2009, 5:15am UTC](https://www.ruby-forum.com/t/javascript-file-structure/161853 "2009-03-03T05:15:18Z")

</div>

hi as far as i know (i’m new on ror) the file structure of javascript files are: app/views/posts/… public/javascripts/\*.js what i understand as a View is final step of the application, the thing that user see, let’…

---

## [First public deployment coming up. How to load test?](https://www.ruby-forum.com/t/first-public-deployment-coming-up-how-to-load-test/161856)

<div class="topic-metadata">

**Author:** [@Raphael\_Lee](https://www.ruby-forum.com/u/Raphael_Lee)\
**Replies:** 1\
**Last updated:** [March 3, 2009, 5:04am UTC](https://www.ruby-forum.com/t/first-public-deployment-coming-up-how-to-load-test/161856 "2009-03-03T05:04:12Z")

</div>

So I’ve been working on a project for a while with some friends, and we’re getting ready to launch the beta. I’ve never built a website on this scale, especially not in Rails, and in the two weeks I have to prepare …

---

## [Phone format in Rails](https://www.ruby-forum.com/t/phone-format-in-rails/161766)

<div class="topic-metadata">

**Author:** [@cool](https://www.ruby-forum.com/u/cool)\
**Replies:** 4\
**Last updated:** [March 3, 2009, 4:54am UTC](https://www.ruby-forum.com/t/phone-format-in-rails/161766 "2009-03-03T04:54:16Z")

</div>

Guys, I have a text field and the name is phone I used to enter contact number. In the new form when i enter 10 digit number like “1234567890” it is displaying 1234567890 I want to display like in US format automati…

---

## [Functional testing - don't create schema each time](https://www.ruby-forum.com/t/functional-testing-dont-create-schema-each-time/161834)

<div class="topic-metadata">

**Author:** [@Obelix](https://www.ruby-forum.com/u/Obelix)\
**Replies:** 2\
**Last updated:** [March 3, 2009, 3:48am UTC](https://www.ruby-forum.com/t/functional-testing-dont-create-schema-each-time/161834 "2009-03-03T03:48:48Z")

</div>

Setting up the data for my rails server is non trivial, it includes schema creation, seeding the database with seed data, running indexing using ferret. I want to write functional tests that use the seed data and indi…

---

## [How can I set Rails user name?](https://www.ruby-forum.com/t/how-can-i-set-rails-user-name/161850)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 2\
**Last updated:** [March 3, 2009, 3:47am UTC](https://www.ruby-forum.com/t/how-can-i-set-rails-user-name/161850 "2009-03-03T03:47:00Z")

</div>

I use root to start the Rails server. So all the operations on this server will be root permission. For example, create a file in the server disk. How can I change a user?

---

## [Sqlite3-ruby gem installation is driving me crazy](https://www.ruby-forum.com/t/sqlite3-ruby-gem-installation-is-driving-me-crazy/137620)

<div class="topic-metadata">

**Author:** [@pReload](https://www.ruby-forum.com/u/pReload)\
**Replies:** 2\
**Last updated:** [March 3, 2009, 3:19am UTC](https://www.ruby-forum.com/t/sqlite3-ruby-gem-installation-is-driving-me-crazy/137620 "2009-03-03T03:19:37Z")

</div>

I installed Rails 1.8.6 on a Panther system. Everything is ok but I can’t install sqlite3-ruby gem. This is the terminal result: $ sudo gem install --local sqlite3-ruby-1.2.1.gem Building native extensions. This cou…

---

## [Installing sqlite3-ruby with rubygems on Ubuntu 8.0.4.1](https://www.ruby-forum.com/t/installing-sqlite3-ruby-with-rubygems-on-ubuntu-8-0-4-1/152855)

<div class="topic-metadata">

**Author:** [@bigchoco](https://www.ruby-forum.com/u/bigchoco)\
**Replies:** 2\
**Last updated:** [March 3, 2009, 3:19am UTC](https://www.ruby-forum.com/t/installing-sqlite3-ruby-with-rubygems-on-ubuntu-8-0-4-1/152855 "2009-03-03T03:19:12Z")

</div>

Hi everyone, I’m on Ubuntu Hardy and I just installed ruby1.8 irb1.8 ri1.8 rdoc1.8 rubygems ruby1.8-dev I then intalled rails with rubygems and had to run the gem update –system command once I wanted to create m…

---

## [Redirected to http but Location is httpS](https://www.ruby-forum.com/t/redirected-to-http-but-location-is-https/130336)

<div class="topic-metadata">

**Author:** [@qertoip](https://www.ruby-forum.com/u/qertoip)\
**Replies:** 1\
**Last updated:** [March 3, 2009, 3:16am UTC](https://www.ruby-forum.com/t/redirected-to-http-but-location-is-https/130336 "2009-03-03T03:16:34Z")

</div>

Rails properly recognizes https requests (request.ssl? == true) and ssl\_requirement properly calls redirect\_to ‘http’ + … In production.log I have: “Redirected to http://www.peroniitaly.pl” But in the HTTP response h…

---

## [Adding a new default verb to RESTful routes](https://www.ruby-forum.com/t/adding-a-new-default-verb-to-restful-routes/161852)

<div class="topic-metadata">

**Author:** [@brendon](https://www.ruby-forum.com/u/brendon)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 3:12am UTC](https://www.ruby-forum.com/t/adding-a-new-default-verb-to-restful-routes/161852 "2009-03-03T03:12:28Z")

</div>

Hi everyone, here’s a simple one, How can I add a new default verb so that every resource added via map.resources has this extra verb: :member =\> { :browse =\> :get } My routes are spread out across engines so I can’t…

---

## [Problem with installing sqlite3-ruby](https://www.ruby-forum.com/t/problem-with-installing-sqlite3-ruby/157486)

<div class="topic-metadata">

**Author:** [@A\_Z](https://www.ruby-forum.com/u/A_Z)\
**Replies:** 4\
**Last updated:** [March 3, 2009, 3:09am UTC](https://www.ruby-forum.com/t/problem-with-installing-sqlite3-ruby/157486 "2009-03-03T03:09:31Z")

</div>

Hi friends I am new to get on the rails & I have allready a problem in installing sqlite3-ruby. I just made my first programme :Hello world.When I execute http://localhost:3000/hello\_world on my browser,then the fol…

---

## [Routes Parameter manipulation](https://www.ruby-forum.com/t/routes-parameter-manipulation/196906)

<div class="topic-metadata">

**Author:** [@Yanir](https://www.ruby-forum.com/u/Yanir)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 12:01am UTC](https://www.ruby-forum.com/t/routes-parameter-manipulation/196906 "2009-03-03T00:01:34Z")

</div>

I am creating a new site to replace an existing one and want to preserve urls that people have bookmarked and appear in search engines. My solution to this is create a route that takes a historical url and pass that a…

---

## [Routes Parameter manipulation](https://www.ruby-forum.com/t/routes-parameter-manipulation/161839)

<div class="topic-metadata">

**Author:** [@Yanir](https://www.ruby-forum.com/u/Yanir)\
**Replies:** 0\
**Last updated:** [March 3, 2009, 12:00am UTC](https://www.ruby-forum.com/t/routes-parameter-manipulation/161839 "2009-03-03T00:00:23Z")

</div>

I am creating a new site to replace an existing one and want to preserve urls that people have bookmarked and appear in search engines. My solution to this is create a route that takes a historical url and pass that a…

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

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