# Rails

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

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

---

## [Testing best practice](https://www.ruby-forum.com/t/testing-best-practice/185337)

<div class="topic-metadata">

**Author:** [@fmcorp](https://www.ruby-forum.com/u/fmcorp)\
**Replies:** 1\
**Last updated:** [March 18, 2010, 3:12pm UTC](https://www.ruby-forum.com/t/testing-best-practice/185337 "2010-03-18T15:12:55Z")

</div>

so what is the best way test bed to use for a rails project? i’m thinking of using Rspec and Cucumber, but where do you do the unit tests? in Rspec?

---

## [One-time script to update 1000s of values in a single column in a table: nil error?](https://www.ruby-forum.com/t/one-time-script-to-update-1000s-of-values-in-a-single-column-in-a-table-nil-error/185317)

<div class="topic-metadata">

**Author:** [@Clay\_H](https://www.ruby-forum.com/u/Clay_H)\
**Replies:** 5\
**Last updated:** [March 18, 2010, 1:46pm UTC](https://www.ruby-forum.com/t/one-time-script-to-update-1000s-of-values-in-a-single-column-in-a-table-nil-error/185317 "2010-03-18T13:46:51Z")

</div>

Hi, I have a model called Stock with a value called “strength.” I wrote a simple method in the Stock.rb model file to update the value of “strength” for each record in the stocks table. I created a controller called f…

---

## [Sending mail using action mailer](https://www.ruby-forum.com/t/sending-mail-using-action-mailer/185335)

<div class="topic-metadata">

**Author:** [@saravanand](https://www.ruby-forum.com/u/saravanand)\
**Replies:** 3\
**Last updated:** [March 18, 2010, 1:26pm UTC](https://www.ruby-forum.com/t/sending-mail-using-action-mailer/185335 "2010-03-18T13:26:02Z")

</div>

Hi everyone, I am new to ruby and i just wanna send an email using ruby action mailer. i have been trying it for about a day. Not achieved. so many replies came in from google but many were beating the bushes … can a…

---

## [ActiveMerchant unit tests](https://www.ruby-forum.com/t/activemerchant-unit-tests/185340)

<div class="topic-metadata">

**Author:** [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Replies:** 0\
**Last updated:** [March 18, 2010, 1:02pm UTC](https://www.ruby-forum.com/t/activemerchant-unit-tests/185340 "2010-03-18T13:02:57Z")

</div>

Hi, I’m testing my ActiveMerchant plugin installation with the iDeal payment method. One test keeps failing even though I’ve inserted all the credentials. The other test file, remote\_ideal\_test.rb, completes 100% of …

---

## [REST and security](https://www.ruby-forum.com/t/rest-and-security/185330)

<div class="topic-metadata">

**Author:** [@Pasalic\_Z](https://www.ruby-forum.com/u/Pasalic_Z)\
**Replies:** 2\
**Last updated:** [March 18, 2010, 12:52pm UTC](https://www.ruby-forum.com/t/rest-and-security/185330 "2010-03-18T12:52:05Z")

</div>

Hi we are creating small site on Rails which fits perfectly into REST model. One of our futures is security model with roles. In general, there are 3 types of users: standard, power-user and administrator. We need al…

---

## [Method\_missing](https://www.ruby-forum.com/t/method-missing/185329)

<div class="topic-metadata">

**Author:** [@eugenio](https://www.ruby-forum.com/u/eugenio)\
**Replies:** 3\
**Last updated:** [March 18, 2010, 12:20pm UTC](https://www.ruby-forum.com/t/method-missing/185329 "2010-03-18T12:20:12Z")

</div>

i’m using method\_missing to implement a simple metaprogramming that checks for account rights. in Account \<\< ActiveRecord::Base i defined: def method\_missing(m, a = {}) if m.to\_s =~ /^has\_right\_(.\*)$/ … calls anothe…

---

## [Asking about ROR site](https://www.ruby-forum.com/t/asking-about-ror-site/185333)

<div class="topic-metadata">

**Author:** [@tenuxx](https://www.ruby-forum.com/u/tenuxx)\
**Replies:** 0\
**Last updated:** [March 18, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/asking-about-ror-site/185333 "2010-03-18T12:05:21Z")

</div>

Hello guys, I wonder what is the core used in storenvy.com and bigcartel.com ? Or those site is just build from the scratch? Im planning to build site that have similar functions… maybe anyone can tell me what is the …

---

## [Email using ruby on rails](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059)

<div class="topic-metadata">

**Author:** [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Replies:** 6\
**Last updated:** [March 18, 2010, 11:19am UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059 "2010-03-18T11:19:54Z")

</div>

ActionMailer::Base.server\_settings = { :address =\> “smtp.tutorialspoint.com”, :port =\> 25, :domain =\> “tutorialspoint.com”, :authentication =\> :login, :user\_name =\> “username”, :password =\> “password”, } Here in …

---

## [Refresh a page using AJAX?](https://www.ruby-forum.com/t/refresh-a-page-using-ajax/185165)

<div class="topic-metadata">

**Author:** [@veena](https://www.ruby-forum.com/u/veena)\
**Replies:** 16\
**Last updated:** [March 18, 2010, 10:40am UTC](https://www.ruby-forum.com/t/refresh-a-page-using-ajax/185165 "2010-03-18T10:40:41Z")

</div>

Hai friends, I want to know how a part of the webpage (data obtained from database) can be refreshed at periodic intervals(say 5 sec). I have tried periodically\_call\_remote() method.But it is not working for me. \<% …

---

## [Rails+prawnto: setting :type to :prawn in a #render\_to\_string call not working](https://www.ruby-forum.com/t/rails-prawnto-setting-type-to-prawn-in-a-render-to-string-call-not-working/185306)

<div class="topic-metadata">

**Author:** [@zettabyte](https://www.ruby-forum.com/u/zettabyte)\
**Replies:** 3\
**Last updated:** [March 18, 2010, 10:06am UTC](https://www.ruby-forum.com/t/rails-prawnto-setting-type-to-prawn-in-a-render-to-string-call-not-working/185306 "2010-03-18T10:06:44Z")

</div>

Hello, my question is rails related though it is also somewhat specific to the prawnto plugin (installed latest version as of 2010-03-15). I would ask on a prawnto forum/list if I knew where one was. Anyhow, I’m usin…

---

## ["require" behaves differently in Rails vs vanilla Ruby?](https://www.ruby-forum.com/t/require-behaves-differently-in-rails-vs-vanilla-ruby/185313)

<div class="topic-metadata">

**Author:** [@Poco\_R](https://www.ruby-forum.com/u/Poco_R)\
**Replies:** 4\
**Last updated:** [March 18, 2010, 10:06am UTC](https://www.ruby-forum.com/t/require-behaves-differently-in-rails-vs-vanilla-ruby/185313 "2010-03-18T10:06:09Z")

</div>

I can “require” a file from the console but not from irb or a simple ruby script. It’s not a path issue, the same file is found in both cases. So why is the module namespace an unrecognized constant sometimes and a …

---

## [Rerender a page if validation fails](https://www.ruby-forum.com/t/rerender-a-page-if-validation-fails/185321)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 4\
**Last updated:** [March 18, 2010, 9:54am UTC](https://www.ruby-forum.com/t/rerender-a-page-if-validation-fails/185321 "2010-03-18T09:54:26Z")

</div>

Hi I have in routes.rb like map.resources :users Now I am trying to edit a user. What the url shows now is http://localhost:3000/users/1/edit But my problem is , when I click on update button and if validations…

---

## [Dynamic cookie domain (for multitenant app)](https://www.ruby-forum.com/t/dynamic-cookie-domain-for-multitenant-app/185324)

<div class="topic-metadata">

**Author:** [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Replies:** 0\
**Last updated:** [March 18, 2010, 7:46am UTC](https://www.ruby-forum.com/t/dynamic-cookie-domain-for-multitenant-app/185324 "2010-03-18T07:46:08Z")

</div>

There is a Multitenant App, that should serve sites on domains like this: client1.app.com client2.app.com And it’s easy to share cookies between all of them (using ‘.app.com’ cookie domain): ActionController::Base.…

---

## [502 proxy error](https://www.ruby-forum.com/t/502-proxy-error/185318)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 0\
**Last updated:** [March 18, 2010, 5:00am UTC](https://www.ruby-forum.com/t/502-proxy-error/185318 "2010-03-18T05:00:24Z")

</div>

Dear Friends, I have deployed my rails application in linux slackware 13 and used apache server. After deployment i was able to access the login page of my web application and when i give my login and password it say…

---

## [Upgrading rails, ruby and gems](https://www.ruby-forum.com/t/upgrading-rails-ruby-and-gems/185117)

<div class="topic-metadata">

**Author:** [@soesan01](https://www.ruby-forum.com/u/soesan01)\
**Replies:** 2\
**Last updated:** [March 18, 2010, 3:22am UTC](https://www.ruby-forum.com/t/upgrading-rails-ruby-and-gems/185117 "2010-03-18T03:22:19Z")

</div>

Hi guys, Is there any good documentation to upgrade rails, ruby and supported gems? I use mac tiger. Also, what is the stable version of ruby? Thanks, ys

---

## [Routing problem for Rails 2 newbie](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 3\
**Last updated:** [March 18, 2010, 12:21am UTC](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096 "2010-03-18T00:21:50Z")

</div>

I’m running: WinXP-Pro/SP3 Rails 2.3.5 MySQL 5.0.37-community-nt Firefox 3.6 browser Mongrel web server I have a Rails 2 app that initially brought up the Welcome screen I ran: ruby script/generate scaffold vendo…

---

## [Problem with content-position and background-color in a sidebar](https://www.ruby-forum.com/t/problem-with-content-position-and-background-color-in-a-sidebar/185289)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 12\
**Last updated:** [March 17, 2010, 11:25pm UTC](https://www.ruby-forum.com/t/problem-with-content-position-and-background-color-in-a-sidebar/185289 "2010-03-17T23:25:52Z")

</div>

In app\\views\\expenses\\new.html.erb, I’ve got (just so I know where the stuff on the page came from, for now): \<% content\_for :sidebar do %\> This is my sidebar stuff from: new.html.erb RTS\\app\\views\\expenses \<% en…

---

## [Passing a block to gsub](https://www.ruby-forum.com/t/passing-a-block-to-gsub/185249)

<div class="topic-metadata">

**Author:** [@perezda](https://www.ruby-forum.com/u/perezda)\
**Replies:** 1\
**Last updated:** [March 17, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/passing-a-block-to-gsub/185249 "2010-03-17T20:32:38Z")

</div>

Hello, So I have a product description field and in that product description field every time I have the @ symbol followed by a product id the following method will replace the @ sign with the products permalink in a…

---

## [\[vlad\] How to install will\_paginate on the server?](https://www.ruby-forum.com/t/vlad-how-to-install-will-paginate-on-the-server/185184)

<div class="topic-metadata">

**Author:** [@trapper](https://www.ruby-forum.com/u/trapper)\
**Replies:** 3\
**Last updated:** [March 17, 2010, 7:58pm UTC](https://www.ruby-forum.com/t/vlad-how-to-install-will-paginate-on-the-server/185184 "2010-03-17T19:58:14Z")

</div>

I successfully installed will\_paginate on my workstation and ist works fine. Now I want to deploy the new version via vlad to my server. I’ve sucessfully run gem install will\_paginate as root. Any attempt to run r…

---

## [Paperclip upload over local network](https://www.ruby-forum.com/t/paperclip-upload-over-local-network/185303)

<div class="topic-metadata">

**Author:** [@SSshaan](https://www.ruby-forum.com/u/SSshaan)\
**Replies:** 0\
**Last updated:** [March 17, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/paperclip-upload-over-local-network/185303 "2010-03-17T19:11:17Z")

</div>

Hello, I am using the Paperclip plugin in one of my rails applications. It has been working absolutely fine so far on my local PC. Recently, I ported the application onto a LAN. I need the image uploading to be possi…

---

## [(JOB) Ruby / Erlang Developer (Cape Town, South Africa)](https://www.ruby-forum.com/t/job-ruby-erlang-developer-cape-town-south-africa/185301)

<div class="topic-metadata">

**Author:** [@Your\_opportunity\_fi](https://www.ruby-forum.com/u/Your_opportunity_fi)\
**Replies:** 0\
**Last updated:** [March 17, 2010, 6:50pm UTC](https://www.ruby-forum.com/t/job-ruby-erlang-developer-cape-town-south-africa/185301 "2010-03-17T18:50:48Z")

</div>

Opportunity to join an international team of developers. Position based in Cape Town. You will be working with a team of highly skilled and experienced RUBY on RAILS and ERLANG developers on a range of hosted mobile i…

---

## [How do I determine the "source" action for conditionally rendering error actions and validation mes](https://www.ruby-forum.com/t/how-do-i-determine-the-source-action-for-conditionally-rendering-error-actions-and-validation-mes/185295)

<div class="topic-metadata">

**Author:** [@Clay\_H](https://www.ruby-forum.com/u/Clay_H)\
**Replies:** 5\
**Last updated:** [March 17, 2010, 6:29pm UTC](https://www.ruby-forum.com/t/how-do-i-determine-the-source-action-for-conditionally-rendering-error-actions-and-validation-mes/185295 "2010-03-17T18:29:44Z")

</div>

I have a model called Stock.rb. I created an additional action, called dispense, in the controller so that I could render two different views based on the type of data entry being done. The “new” action is used for “a…

---

## [Recommendations for pdf generators](https://www.ruby-forum.com/t/recommendations-for-pdf-generators/185229)

<div class="topic-metadata">

**Author:** [@ct9a](https://www.ruby-forum.com/u/ct9a)\
**Replies:** 7\
**Last updated:** [March 17, 2010, 5:52pm UTC](https://www.ruby-forum.com/t/recommendations-for-pdf-generators/185229 "2010-03-17T17:52:51Z")

</div>

hi, everyone, i have googled around for some pdf generators. Found PDF::Writer which is a little dated Rupdf (http://scoop.simplyexcited.co.uk//2007/12/15/rupdf-simple- ruby-pdf-rails-plugin/ and http://agilewebdevel…

---

## [Writing a large file with Spreadsheet: very slow, any HELP?](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 3\
**Last updated:** [March 17, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251 "2010-03-17T16:35:38Z")

</div>

Hey, I’m using the Spreadsheet gem to generate Excel files. It’s worked great up until now. I’m trying to put 25,000 rows in a sheet, then doing book.write to write the file. It’s really slow, like 3-4 minutes. Is…

---

## [Bundler 0.9.x and rails 2.3.5 problem](https://www.ruby-forum.com/t/bundler-0-9-x-and-rails-2-3-5-problem/185293)

<div class="topic-metadata">

**Author:** [@jessy](https://www.ruby-forum.com/u/jessy)\
**Replies:** 0\
**Last updated:** [March 17, 2010, 4:31pm UTC](https://www.ruby-forum.com/t/bundler-0-9-x-and-rails-2-3-5-problem/185293 "2010-03-17T16:31:40Z")

</div>

Hi all! A simple question to you pros, is it possible to make autoinstall of gems when rails application is run (on mongrel1.1.5)? This was my intention when I today started to look at bundler, but until now it has o…

---

## [Sometimes losing decimal scale on mysql - ok on sqlite](https://www.ruby-forum.com/t/sometimes-losing-decimal-scale-on-mysql-ok-on-sqlite/185275)

<div class="topic-metadata">

**Author:** [@Owain](https://www.ruby-forum.com/u/Owain)\
**Replies:** 3\
**Last updated:** [March 17, 2010, 3:45pm UTC](https://www.ruby-forum.com/t/sometimes-losing-decimal-scale-on-mysql-ok-on-sqlite/185275 "2010-03-17T15:45:15Z")

</div>

I posted this yesterday but it was a bit long-winded: http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/9a6db7467a16911e Here is a more succinct version. Migration generates decimal(8,2) column type…

---

## [Using group\_to() and aggregation for a simple inventory system @ a field hospital in Haiti](https://www.ruby-forum.com/t/using-group-to-and-aggregation-for-a-simple-inventory-system-a-field-hospital-in-haiti/185201)

<div class="topic-metadata">

**Author:** [@Clay\_H](https://www.ruby-forum.com/u/Clay_H)\
**Replies:** 9\
**Last updated:** [March 17, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/using-group-to-and-aggregation-for-a-simple-inventory-system-a-field-hospital-in-haiti/185201 "2010-03-17T15:37:38Z")

</div>

Hi, I’m pretty much a Rails newbie here… I put together a very simple pharmaceutical inventory system for a field hospital in Haiti. When we first started, there was nothing but a list of medicines that were known to …

---

## [Paginator Question](https://www.ruby-forum.com/t/paginator-question/185272)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 3\
**Last updated:** [March 17, 2010, 1:01pm UTC](https://www.ruby-forum.com/t/paginator-question/185272 "2010-03-17T13:01:12Z")

</div>

Hi i using rails paginator class in my application like below @log\_pages = Paginator.new(self, @logs.length, items\_per\_page, page) i would like to know how can check whether the current page is last page or not? Th…

---

## [To\_xml repeating elements and plain strings](https://www.ruby-forum.com/t/to-xml-repeating-elements-and-plain-strings/184777)

<div class="topic-metadata">

**Author:** [@harry-weeds](https://www.ruby-forum.com/u/harry-weeds)\
**Replies:** 1\
**Last updated:** [March 17, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/to-xml-repeating-elements-and-plain-strings/184777 "2010-03-17T12:40:09Z")

</div>

Say I want to output XML like this: 123 apple banana pear lemon Is there a way of doing that with to\_xml? It seems like there’s two problems: to\_xml always creates a wrapping element when it encounters an…

---

## [REST, Internet Explorer and the banned DELETE method](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 4\
**Last updated:** [March 17, 2010, 11:47am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276 "2010-03-17T11:47:35Z")

</div>

Hi all As we all know, in REST the ResourceController#delete action is called by calling “/resources/:id” with a delete method. But, the delete method is not supported in IE. This seems like a problem to me. How do …

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

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