# Rails

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

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

---

## [Html file](https://www.ruby-forum.com/t/html-file/144077)

<div class="topic-metadata">

**Author:** [@sujith](https://www.ruby-forum.com/u/sujith)\
**Replies:** 1\
**Last updated:** [July 25, 2008, 10:24am UTC](https://www.ruby-forum.com/t/html-file/144077 "2008-07-25T10:24:39Z")

</div>

i am showing some document in browser as html usin ruby on rails i dont want to copy and paste the content from the browser we can write any code for that in ruby pls help me

---

## [Link\_to option](https://www.ruby-forum.com/t/link-to-option/144088)

<div class="topic-metadata">

**Author:** [@sujith](https://www.ruby-forum.com/u/sujith)\
**Replies:** 0\
**Last updated:** [July 25, 2008, 8:43am UTC](https://www.ruby-forum.com/t/link-to-option/144088 "2008-07-25T08:43:18Z")

</div>

can i use onload event in link\_to using ruby on rails

---

## [Startup looking for Rails talent](https://www.ruby-forum.com/t/startup-looking-for-rails-talent/144084)

<div class="topic-metadata">

**Author:** [@xgamerx](https://www.ruby-forum.com/u/xgamerx)\
**Replies:** 1\
**Last updated:** [July 25, 2008, 8:32am UTC](https://www.ruby-forum.com/t/startup-looking-for-rails-talent/144084 "2008-07-25T08:32:23Z")

</div>

Hello G.s! This isn’t spam I swear! I currently work for a very young startup. We are about a month away from our initial release. We are still a bit in stealth mode but the site is deployed and we have a small user b…

---

## [Duplicating table data into another table](https://www.ruby-forum.com/t/duplicating-table-data-into-another-table/144079)

<div class="topic-metadata">

**Author:** [@shaily903](https://www.ruby-forum.com/u/shaily903)\
**Replies:** 0\
**Last updated:** [July 25, 2008, 7:17am UTC](https://www.ruby-forum.com/t/duplicating-table-data-into-another-table/144079 "2008-07-25T07:17:49Z")

</div>

Requirement: I am designing a Customer invoice system for a service company. company has some default rates across the company which is based on designation, experience level, qualification etc. These rates can be cha…

---

## [15 minute blog tutorial](https://www.ruby-forum.com/t/15-minute-blog-tutorial/143938)

<div class="topic-metadata">

**Author:** [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Replies:** 4\
**Last updated:** [July 25, 2008, 6:00am UTC](https://www.ruby-forum.com/t/15-minute-blog-tutorial/143938 "2008-07-25T06:00:08Z")

</div>

Ever since Rails 2.0 has come out, the 15 minute tutorial on the site that is so popular is broken. How about we rally up the community to replace this with a proper tutorial that isn’t broken? Many people would’ve tr…

---

## [Building a really DRY infra-structure: sharing a database and models between multiple apps](https://www.ruby-forum.com/t/building-a-really-dry-infra-structure-sharing-a-database-and-models-between-multiple-apps/144073)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 0\
**Last updated:** [July 25, 2008, 5:30am UTC](https://www.ruby-forum.com/t/building-a-really-dry-infra-structure-sharing-a-database-and-models-between-multiple-apps/144073 "2008-07-25T05:30:19Z")

</div>

Hello, I was wondering about database/model sharing between applications. In the previous company I worked, my boss thought that the best way to build a strong application infra-structure (kind of SOA-based) was to h…

---

## [Deleting model objects](https://www.ruby-forum.com/t/deleting-model-objects/144056)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 4\
**Last updated:** [July 25, 2008, 4:36am UTC](https://www.ruby-forum.com/t/deleting-model-objects/144056 "2008-07-25T04:36:29Z")

</div>

def remove\_req @posts = Post.find\_all\_by\_requirement\_id(params\[:id\]) @posts.each do |post| post.destroy end redirect\_to :action =\> :index end \<%= link\_to ‘Remove’, :url =\> { :action =\> ‘remove\_req’ }, :id=\>post.r…

---

## [Find :last](https://www.ruby-forum.com/t/find-last/144051)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 14\
**Last updated:** [July 25, 2008, 4:27am UTC](https://www.ruby-forum.com/t/find-last/144051 "2008-07-25T04:27:41Z")

</div>

When I use Model.find(:last) I get an error saying that it can’t find an ID=last. How come?

---

## [More Rails-ish Way?](https://www.ruby-forum.com/t/more-rails-ish-way/143950)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 4\
**Last updated:** [July 25, 2008, 4:23am UTC](https://www.ruby-forum.com/t/more-rails-ish-way/143950 "2008-07-25T04:23:35Z")

</div>

I need to to an update with a a join. Is there a better way than this? Token.connection.update “UPDATE tokens INNER JOIN items\_tokens ON tokens.id = items\_tokens.token\_id SET field=field-1 WHERE items\_tokens.item\_id …

---

## [Creating has\_and\_belongs\_to\_many from legacy data](https://www.ruby-forum.com/t/creating-has-and-belongs-to-many-from-legacy-data/144069)

<div class="topic-metadata">

**Author:** [@jay](https://www.ruby-forum.com/u/jay)\
**Replies:** 0\
**Last updated:** [July 25, 2008, 4:06am UTC](https://www.ruby-forum.com/t/creating-has-and-belongs-to-many-from-legacy-data/144069 "2008-07-25T04:06:37Z")

</div>

I’ve just started using rails and I have a legacy DB with 2 models that have a habtm relationship. I know how to specify the association, but how do I create the associations from my legacy data? Thanks, Jay

---

## [Link\_to\_remote :with =\> multiple items](https://www.ruby-forum.com/t/link-to-remote-with-multiple-items/144033)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 4\
**Last updated:** [July 25, 2008, 4:06am UTC](https://www.ruby-forum.com/t/link-to-remote-with-multiple-items/144033 "2008-07-25T04:06:37Z")

</div>

Hi, How do I pass multiple params? :with =\> “‘p1=’ + ‘blah’” I also want to pass ‘p2=’ + ‘blah’, etc… thanks

---

## [Using strptime to create a date object](https://www.ruby-forum.com/t/using-strptime-to-create-a-date-object/144066)

<div class="topic-metadata">

**Author:** [@paradise](https://www.ruby-forum.com/u/paradise)\
**Replies:** 2\
**Last updated:** [July 25, 2008, 2:14am UTC](https://www.ruby-forum.com/t/using-strptime-to-create-a-date-object/144066 "2008-07-25T02:14:28Z")

</div>

Im wondering if it is possible to turn a string with a month name such as: “July 20, 2008” directly into a date object using strptime. If this is not possible am I going to have to write my own function to do this? I…

---

## [Config.after\_initialize doesn't seem to run](https://www.ruby-forum.com/t/config-after-initialize-doesnt-seem-to-run/144058)

<div class="topic-metadata">

**Author:** [@kuma](https://www.ruby-forum.com/u/kuma)\
**Replies:** 2\
**Last updated:** [July 24, 2008, 11:57pm UTC](https://www.ruby-forum.com/t/config-after-initialize-doesnt-seem-to-run/144058 "2008-07-24T23:57:29Z")

</div>

At the end of config/development.rb I have: config.after\_initialize do ExceptionNotifier.exception\_recipients = \[‘removed\_email\_address@domain.invalid’\] FOOBAR = ‘123’ # Just for testing end Now, when I run script/c…

---

## [Strange change in form\_tag behavior from 2.0 to 2.1?](https://www.ruby-forum.com/t/strange-change-in-form-tag-behavior-from-2-0-to-2-1/144035)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 11:28pm UTC](https://www.ruby-forum.com/t/strange-change-in-form-tag-behavior-from-2-0-to-2-1/144035 "2008-07-24T23:28:18Z")

</div>

I’ve used an approach frequently in the past where I create a method in the model that when passed parameters from a selection form returns a modified result set. As an example the routine in the model looks like this…

---

## [Apache, Mongrel clusters and sub domains](https://www.ruby-forum.com/t/apache-mongrel-clusters-and-sub-domains/144042)

<div class="topic-metadata">

**Author:** [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Replies:** 2\
**Last updated:** [July 24, 2008, 11:27pm UTC](https://www.ruby-forum.com/t/apache-mongrel-clusters-and-sub-domains/144042 "2008-07-24T23:27:42Z")

</div>

There seems to be a ton of documentation out there, but I can’t seem to figure out how to get this to work. I’ve got two rails apps: app1, which should be available at http://www.domain.com and app2 which should be av…

---

## [Help speeding up this code?](https://www.ruby-forum.com/t/help-speeding-up-this-code/143995)

<div class="topic-metadata">

**Author:** [@amanda](https://www.ruby-forum.com/u/amanda)\
**Replies:** 2\
**Last updated:** [July 24, 2008, 11:23pm UTC](https://www.ruby-forum.com/t/help-speeding-up-this-code/143995 "2008-07-24T23:23:50Z")

</div>

Hi there, I am working on an events site where there are a bunch of different calendars (for different groups of people) that display submitted events that belong to that calendar, the dates for the events are kept as…

---

## [Need help with report building. PDF or IMG or what?](https://www.ruby-forum.com/t/need-help-with-report-building-pdf-or-img-or-what/144032)

<div class="topic-metadata">

**Author:** [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Replies:** 4\
**Last updated:** [July 24, 2008, 9:59pm UTC](https://www.ruby-forum.com/t/need-help-with-report-building-pdf-or-img-or-what/144032 "2008-07-24T21:59:49Z")

</div>

This is real important, so I hope you can help! Okay I have to take this report: http://www.ub04.net/downloads/UB04\_10-23-06\_B%20W%20PDF.pdf and fill it in with ruby on rails. I need advice on the best way to do tha…

---

## [Errno::EBADF Send an Email in Rails using GMail](https://www.ruby-forum.com/t/errno-ebadf-send-an-email-in-rails-using-gmail/226019)

<div class="topic-metadata">

**Author:** [@Walter\_Lockhart](https://www.ruby-forum.com/u/Walter_Lockhart)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/errno-ebadf-send-an-email-in-rails-using-gmail/226019 "2008-07-24T21:50:43Z")

</div>

Hi, would someone please help me. I have been desperatley trying to fnd out for the last two days why the following code is not working. Any ideas. I’m running Instant Rails 1.4 / Rails version 1.2.5 / Ruby version …

---

## [Quick Question about Linux command from Controller](https://www.ruby-forum.com/t/quick-question-about-linux-command-from-controller/143896)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 6\
**Last updated:** [July 24, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/quick-question-about-linux-command-from-controller/143896 "2008-07-24T21:43:02Z")

</div>

Good morning, I am trying to execute a linux command from inside my controller. It works on my development machine, but does not work in production. Here is the code. def get\_whois @the\_site = Site.find\_by\_id(para…

---

## [Apache/Mongrel/Rails relative path problem](https://www.ruby-forum.com/t/apache-mongrel-rails-relative-path-problem/144006)

<div class="topic-metadata">

**Author:** [@jack](https://www.ruby-forum.com/u/jack)\
**Replies:** 8\
**Last updated:** [July 24, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/apache-mongrel-rails-relative-path-problem/144006 "2008-07-24T21:41:15Z")

</div>

Folks, I know this is probably a little off topic since I’m looking for Apache/Mongrel help with a RoR application. But I can’t seem to find anything to shed some light and was hoping someone on here might be able to…

---

## [DATABASE update](https://www.ruby-forum.com/t/database-update/144041)

<div class="topic-metadata">

**Author:** [@erenrib](https://www.ruby-forum.com/u/erenrib)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 9:39pm UTC](https://www.ruby-forum.com/t/database-update/144041 "2008-07-24T21:39:29Z")

</div>

Hi, I’m new here and I have a question. How can I modify my DATABASE without touching MySQL using Rails? Regards, Geraldo Santos

---

## [Linking to a url through a selection list](https://www.ruby-forum.com/t/linking-to-a-url-through-a-selection-list/144044)

<div class="topic-metadata">

**Author:** [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 9:35pm UTC](https://www.ruby-forum.com/t/linking-to-a-url-through-a-selection-list/144044 "2008-07-24T21:35:27Z")

</div>

I have routes.rb set up so that when I go to mydomain.com/name it goes directly to a person’s public page: map.connect ‘:name’, :controller =\> ‘main’, :action =\> ‘page’ Now, I want a selection list, that when a name i…

---

## [Will\_paginate](https://www.ruby-forum.com/t/will-paginate/144034)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 9:31pm UTC](https://www.ruby-forum.com/t/will-paginate/144034 "2008-07-24T21:31:28Z")

</div>

paginate :per\_page =\> 15, :page =\> page, :conditions =\> \[‘title like ?’, “%#{search}%”\], :order =\> ‘requirement\_id DESC, created\_at DESC’ In my table: requirement\_id/created\_at 1/5am 1/3am 2/5pm 2/3pm How can I…

---

## [Xml and habtm associations](https://www.ruby-forum.com/t/xml-and-habtm-associations/144039)

<div class="topic-metadata">

**Author:** [@Fernando\_Raganhan\_B](https://www.ruby-forum.com/u/Fernando_Raganhan_B)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/xml-and-habtm-associations/144039 "2008-07-24T21:18:14Z")

</div>

Hi, I am building an app in rails and i’m having some trouble in passing a model object to xml. The model name is event and it habtm videos, I’d like to pass the event information (name, date, description) as well th…

---

## [Can Two Active Record Results be Added?](https://www.ruby-forum.com/t/can-two-active-record-results-be-added/143996)

<div class="topic-metadata">

**Author:** [@Jorg\_L](https://www.ruby-forum.com/u/Jorg_L)\
**Replies:** 6\
**Last updated:** [July 24, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/can-two-active-record-results-be-added/143996 "2008-07-24T21:04:41Z")

</div>

I have an sql with some inputs,notably a date. For that date I run the sql and get a result @result = Model.find\_by\_sql(sql) What I want is to have eight versions of this (different dates in the sql) and then combin…

---

## [Problem with test file for latest ruby on rails](https://www.ruby-forum.com/t/problem-with-test-file-for-latest-ruby-on-rails/144037)

<div class="topic-metadata">

**Author:** [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/problem-with-test-file-for-latest-ruby-on-rails/144037 "2008-07-24T20:49:16Z")

</div>

I downloaded the latest rails from the website and it gives the following test file: require ‘test\_helper’ class ArticleTest \< ActiveSupport::TestCase Replace this with your real tests. def test\_truth assert true e…

---

## [Before\_thumbnail\_saved - attachment\_fu helper does not work](https://www.ruby-forum.com/t/before-thumbnail-saved-attachment-fu-helper-does-not-work/143438)

<div class="topic-metadata">

**Author:** [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/before-thumbnail-saved-attachment-fu-helper-does-not-work/143438 "2008-07-24T20:41:12Z")

</div>

Hi, I have added these lines in my model, but it does not work. before\_thumbnail\_saved do |record, thumbnail| thumbnail.update\_attribute(:filename, thumbnail.public\_filename(thumbnail.thumbnail.to\_sym)) end It keep…

---

## [Instance variables created in controller are nil in view](https://www.ruby-forum.com/t/instance-variables-created-in-controller-are-nil-in-view/144019)

<div class="topic-metadata">

**Author:** [@Elegia](https://www.ruby-forum.com/u/Elegia)\
**Replies:** 4\
**Last updated:** [July 24, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/instance-variables-created-in-controller-are-nil-in-view/144019 "2008-07-24T20:41:12Z")

</div>

Hi all. I’m new to RoR and trying to figure out instance variables. I’m trying to put a string in one in the controller and print it in the view. However I’m getting the following error: NoMethodError in Say#hello Y…

---

## [Transfer the database from a RoR project to another one](https://www.ruby-forum.com/t/transfer-the-database-from-a-ror-project-to-another-one/144024)

<div class="topic-metadata">

**Author:** [@julien51](https://www.ruby-forum.com/u/julien51)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/transfer-the-database-from-a-ror-project-to-another-one/144024 "2008-07-24T20:22:27Z")

</div>

Hi, I am currently working on a version 2 of an existing RoR. Actually, the first version was so bad that we had to rewrite almost everyhting, including many models. Nevertheless, we now need to “migrate” the data fr…

---

## [Link\_to\_remote :with =\> model.object.col](https://www.ruby-forum.com/t/link-to-remote-with-model-object-col/144030)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/link-to-remote-with-model-object-col/144030 "2008-07-24T19:42:57Z")

</div>

Hi, how would I pass a model field/column as a param: \<% for post in @posts %\> \<%= link\_to\_remote “New Requirement”, :url =\> { :action =\> :new\_req }, :with=\>"‘description=’ + post.title " %\> \<% end %\> Namely, :with=\>…

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

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