# Rails

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

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

---

## [Difference in writing a class file in lib and models folder](https://www.ruby-forum.com/t/difference-in-writing-a-class-file-in-lib-and-models-folder/165127)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 5\
**Last updated:** [April 11, 2009, 1:10am UTC](https://www.ruby-forum.com/t/difference-in-writing-a-class-file-in-lib-and-models-folder/165127 "2009-04-11T01:10:01Z")

</div>

Hi I would like to know the difference between writing our own class file(or module) in lib folder and models folder (Or any other folder). Actually what is the use of this lib folder in rails…Cant I write the same i…

---

## [We launch the translation of Rails Guides to pt-br](https://www.ruby-forum.com/t/we-launch-the-translation-of-rails-guides-to-pt-br/165262)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 0\
**Last updated:** [April 11, 2009, 12:48am UTC](https://www.ruby-forum.com/t/we-launch-the-translation-of-rails-guides-to-pt-br/165262 "2009-04-11T00:48:06Z")

</div>

I’m glad to announce that today we have put online our effort to translate all content of rails guides to brazilian-portuguese. The translation is a huge work because guides are updated almost everyday project. So, I…

---

## [Rails2.3/ruby1.9: invalid byte sequence in utf-8 with blank?](https://www.ruby-forum.com/t/rails2-3-ruby1-9-invalid-byte-sequence-in-utf-8-with-blank/165258)

<div class="topic-metadata">

**Author:** [@buddycat](https://www.ruby-forum.com/u/buddycat)\
**Replies:** 4\
**Last updated:** [April 11, 2009, 12:31am UTC](https://www.ruby-forum.com/t/rails2-3-ruby1-9-invalid-byte-sequence-in-utf-8-with-blank/165258 "2009-04-11T00:31:45Z")

</div>

hi all, anyone seen this controller argument error: invalid byte sequence in utf-8 ror/vendor/rails/activesupport/lib/active\_support/core\_ext/blank.rb: 50:in =~' ror/vendor/rails/activesupport/lib/active\_support/core…

---

## [Adding methods, accessing from console and rake tasks](https://www.ruby-forum.com/t/adding-methods-accessing-from-console-and-rake-tasks/165205)

<div class="topic-metadata">

**Author:** [@LukeG](https://www.ruby-forum.com/u/LukeG)\
**Replies:** 2\
**Last updated:** [April 10, 2009, 11:53pm UTC](https://www.ruby-forum.com/t/adding-methods-accessing-from-console-and-rake-tasks/165205 "2009-04-10T23:53:44Z")

</div>

another noob question… how do I add methods to a class such that they can be access from the console and from rake? Details: I have a ruby script to fetch tweets from the search api. That works fine, saves my tweets …

---

## [ActiveRecord.create using Mysql builtin methods?](https://www.ruby-forum.com/t/activerecord-create-using-mysql-builtin-methods/165259)

<div class="topic-metadata">

**Author:** [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 11:23pm UTC](https://www.ruby-forum.com/t/activerecord-create-using-mysql-builtin-methods/165259 "2009-04-10T23:23:54Z")

</div>

Hello, Basically, I need to do an insert such as: create( ‘user\_id’ =\> “#{uid}”, ‘cre\_date’ =\> ‘date\_add(now(), interval 12 hour)’, ‘expire\_date’ =\> ‘now()’, ‘upd\_date’ =\> ‘now()’ ) where, date\_add() an…

---

## [Custom validations - where's the original value](https://www.ruby-forum.com/t/custom-validations-wheres-the-original-value/165216)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 3\
**Last updated:** [April 10, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/custom-validations-wheres-the-original-value/165216 "2009-04-10T23:15:06Z")

</div>

Playing with custom validations (i need to start doing this) This works… def validate errors.add :date\_of\_birth, 'is not a valid date' if Chronic.parse(date\_of\_birth.to\_s).nil? end Trouble is when the form is re-r…

---

## [MySql Memory Error](https://www.ruby-forum.com/t/mysql-memory-error/165260)

<div class="topic-metadata">

**Author:** [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Replies:** 0\
**Last updated:** [April 10, 2009, 11:11pm UTC](https://www.ruby-forum.com/t/mysql-memory-error/165260 "2009-04-10T23:11:36Z")

</div>

I am getting the following error when I try the following code. controller.rb def index @stats = SubscriptionPayment.stats if params\[:page\].blank? @subscriptions = Subscription.paginate(:include =\> :account, :page =\>…

---

## [After updating to Rails 2.3.2 whole enviroment broke. Help!](https://www.ruby-forum.com/t/after-updating-to-rails-2-3-2-whole-enviroment-broke-help/165178)

<div class="topic-metadata">

**Author:** [@slafochmed](https://www.ruby-forum.com/u/slafochmed)\
**Replies:** 4\
**Last updated:** [April 10, 2009, 10:34pm UTC](https://www.ruby-forum.com/t/after-updating-to-rails-2-3-2-whole-enviroment-broke-help/165178 "2009-04-10T22:34:00Z")

</div>

Hi, I don’t know what to do. I upgraded to Rails 2.3.2 (from 2.2.2) and everything worked fine. Then I installed the gem gettext\_rails following this manual: http://www.yotabanana.com/hiki/ruby-gettext-rails-migratio…

---

## [Ruby on Rails Developer - Beaverton, OR](https://www.ruby-forum.com/t/ruby-on-rails-developer-beaverton-or/165256)

<div class="topic-metadata">

**Author:** [@Bala](https://www.ruby-forum.com/u/Bala)\
**Replies:** 0\
**Last updated:** [April 10, 2009, 9:44pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-developer-beaverton-or/165256 "2009-04-10T21:44:55Z")

</div>

Developer - Ruby on Rails Applications Location: Beaverton, OR Duration: 12 months Department/Team Description: The IT/Technology Development Group is comprised of three individuals, including the ETW. Candidat…

---

## [Problem with Insertion](https://www.ruby-forum.com/t/problem-with-insertion/165253)

<div class="topic-metadata">

**Author:** [@avalin](https://www.ruby-forum.com/u/avalin)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/problem-with-insertion/165253 "2009-04-10T20:56:18Z")

</div>

I have a model called Room, and I am trying to allow the user to create favorites to bookmark certain rooms. The Favorites table contains the fields “room\_id” and “user\_id”, and in the view for /rooms/:id I have the …

---

## [ActiveRecord question](https://www.ruby-forum.com/t/activerecord-question/165246)

<div class="topic-metadata">

**Author:** [@enrico](https://www.ruby-forum.com/u/enrico)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/activerecord-question/165246 "2009-04-10T20:50:24Z")

</div>

Hello there, newbie speaking Let’s say I have: class Office has\_many :holidays #(just a list of dates when the office is closed) has\_many :doctors #doctors who work in the office end class Doctor belongs\_to :offic…

---

## [File updated date](https://www.ruby-forum.com/t/file-updated-date/165242)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 7:45pm UTC](https://www.ruby-forum.com/t/file-updated-date/165242 "2009-04-10T19:45:58Z")

</div>

How to get date when file (application\_helper.rb) was updated?

---

## [ActiveRecord belongs\_to ActiveResource](https://www.ruby-forum.com/t/activerecord-belongs-to-activeresource/165250)

<div class="topic-metadata">

**Author:** [@frogstarr78](https://www.ruby-forum.com/u/frogstarr78)\
**Replies:** 0\
**Last updated:** [April 10, 2009, 7:37pm UTC](https://www.ruby-forum.com/t/activerecord-belongs-to-activeresource/165250 "2009-04-10T19:37:11Z")

</div>

class Thing \< ActiveRecord::Base belongs\_to :other\_thing end class OtherThing \< ActiveResource::Base self.site = … end The association here works. I can access other\_thing from thing with no problems until, as usu…

---

## [Question on clearing Active Record objects](https://www.ruby-forum.com/t/question-on-clearing-active-record-objects/165238)

<div class="topic-metadata">

**Author:** [@mifi](https://www.ruby-forum.com/u/mifi)\
**Replies:** 3\
**Last updated:** [April 10, 2009, 7:29pm UTC](https://www.ruby-forum.com/t/question-on-clearing-active-record-objects/165238 "2009-04-10T19:29:58Z")

</div>

I have the following function that will do a query for me, the problem I am having (being new to Ruby and RoR) is how to reinitialize the object. Right now it always returns the same value. class AutoHarnesses \< Activ…

---

## [Single table inheritance and find(:all) in parent](https://www.ruby-forum.com/t/single-table-inheritance-and-find-all-in-parent/165076)

<div class="topic-metadata">

**Author:** [@stephen\_OSD](https://www.ruby-forum.com/u/stephen_OSD)\
**Replies:** 2\
**Last updated:** [April 10, 2009, 6:35pm UTC](https://www.ruby-forum.com/t/single-table-inheritance-and-find-all-in-parent/165076 "2009-04-10T18:35:40Z")

</div>

I understand how STI works, in that I have say a Post model that contains posts on a forum and several sub-posts like ‘ordinaryUserPost’ and ‘adminUserPost’ etc. Now, I want to define the same method in each of the su…

---

## [Periods in parameter](https://www.ruby-forum.com/t/periods-in-parameter/165243)

<div class="topic-metadata">

**Author:** [@ian](https://www.ruby-forum.com/u/ian)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/periods-in-parameter/165243 "2009-04-10T18:20:25Z")

</div>

I have a tag cloud going and a route defined like so: map.connect ‘tags/:id’, :controller =\> “tag”, :action =\> “browse” Works great, except when the phrase has a period in it (like “Web 2.0”) Then I get a 404, presum…

---

## [Problem when migrating from rails 2.2.2 to rails 2.3.2 on linux SLES10 + apache 2](https://www.ruby-forum.com/t/problem-when-migrating-from-rails-2-2-2-to-rails-2-3-2-on-linux-sles10-apache-2/165092)

<div class="topic-metadata">

**Author:** [@Madchipset](https://www.ruby-forum.com/u/Madchipset)\
**Replies:** 8\
**Last updated:** [April 10, 2009, 5:05pm UTC](https://www.ruby-forum.com/t/problem-when-migrating-from-rails-2-2-2-to-rails-2-3-2-on-linux-sles10-apache-2/165092 "2009-04-10T17:05:54Z")

</div>

When I do this migration and I want to launch mongrel\_cluster (mongrel\_rails cluster::start), I get an error : \*\* Starting Mongrel listening at 127.0.0.1:3010 \*\* Starting Rails with production environment… \*\* Mountin…

---

## [501 \<\>: missing or malformed local part](https://www.ruby-forum.com/t/501-missing-or-malformed-local-part/165160)

<div class="topic-metadata">

**Author:** [@semi](https://www.ruby-forum.com/u/semi)\
**Replies:** 2\
**Last updated:** [April 10, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/501-missing-or-malformed-local-part/165160 "2009-04-10T17:01:48Z")

</div>

I get this error when trying to use the actionmailer gem: Net::SMTPSyntaxError in EmailerController#sendmail 501 \<\>: missing or malformed local part Application Trace | Framework Trace | Full Trace /usr/lib/ruby/1.8/…

---

## [Special case rendering from filter](https://www.ruby-forum.com/t/special-case-rendering-from-filter/165075)

<div class="topic-metadata">

**Author:** [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Replies:** 2\
**Last updated:** [April 10, 2009, 4:00pm UTC](https://www.ruby-forum.com/t/special-case-rendering-from-filter/165075 "2009-04-10T16:00:10Z")

</div>

I have a special case(does not normally occur) render in a filter. Because its in a filter, I can’t end execution with a ‘return’ which would work otherwise. Therefore I get this error: Can only render or redirect onc…

---

## [Fwd: Hitler Reborn in SriLanka](https://www.ruby-forum.com/t/fwd-hitler-reborn-in-srilanka/165236)

<div class="topic-metadata">

**Author:** [@rbalaji](https://www.ruby-forum.com/u/rbalaji)\
**Replies:** 0\
**Last updated:** [April 10, 2009, 3:24pm UTC](https://www.ruby-forum.com/t/fwd-hitler-reborn-in-srilanka/165236 "2009-04-10T15:24:32Z")

</div>

\---------- Forwarded message ---------- From: Marimuthu N. removed\_email\_address@domain.invalid Date: Fri, Apr 10, 2009 at 1:39 AM Subject: Hitler Reborn in SriLanka To: “gokul@krishn@n Deivasigamani” removed\_email\_a…

---

## ['\[' and '\]' characters are not valid characters of a URI query component](https://www.ruby-forum.com/t/and-characters-are-not-valid-characters-of-a-uri-query-component/165171)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 10\
**Last updated:** [April 10, 2009, 2:45pm UTC](https://www.ruby-forum.com/t/and-characters-are-not-valid-characters-of-a-uri-query-component/165171 "2009-04-10T14:45:54Z")

</div>

Do the RFCs and whatnot list those characters as valid in a URI query? The question comes up because - despite Rails’s joyful abuse of those characters to delimit records - some of our params are coming in not like th…

---

## [Mvc](https://www.ruby-forum.com/t/mvc/165139)

<div class="topic-metadata">

**Author:** [@mift99](https://www.ruby-forum.com/u/mift99)\
**Replies:** 4\
**Last updated:** [April 10, 2009, 1:56pm UTC](https://www.ruby-forum.com/t/mvc/165139 "2009-04-10T13:56:43Z")

</div>

Hi, i am wondering about the MVC pattern, I havent worked with that for a long time and before I break it I would like to ask your advice… if I have a birthday calender visible in nearly every view where would I put …

---

## [Can Rails App v 1.2.6 work on Server with Rails v 2.3.2?](https://www.ruby-forum.com/t/can-rails-app-v-1-2-6-work-on-server-with-rails-v-2-3-2/165226)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 1:00pm UTC](https://www.ruby-forum.com/t/can-rails-app-v-1-2-6-work-on-server-with-rails-v-2-3-2/165226 "2009-04-10T13:00:25Z")

</div>

Hi, I am trying to get a site up - the problem is that the application is coded using Rails 1.2.6 and the server has Rails 2.3.3. Is it possible to get my site working? How do I do it? Any help would be greatly appre…

---

## [Running a script on a users PC](https://www.ruby-forum.com/t/running-a-script-on-a-users-pc/165227)

<div class="topic-metadata">

**Author:** [@jmac](https://www.ruby-forum.com/u/jmac)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/running-a-script-on-a-users-pc/165227 "2009-04-10T12:59:15Z")

</div>

I am researching a new rails app that would like to create. One feature of the app will allow users to select a ruby script and run it on their local machine. However I’m not sure how to implement this. There are a fe…

---

## [Ruby and mysql syntax? tried single quotes, double, none,](https://www.ruby-forum.com/t/ruby-and-mysql-syntax-tried-single-quotes-double-none/102232)

<div class="topic-metadata">

**Author:** [@koloa](https://www.ruby-forum.com/u/koloa)\
**Replies:** 3\
**Last updated:** [April 10, 2009, 12:43pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql-syntax-tried-single-quotes-double-none/102232 "2009-04-10T12:43:10Z")

</div>

Hi, how do i use passed in arguments and convert those to something sql can understand? do the aliases have to be double qouted? single qouted? i think i tried all but no avail…thanks! def get\_count(doctype, towne) @…

---

## [Testing a gem outside the rails framework](https://www.ruby-forum.com/t/testing-a-gem-outside-the-rails-framework/165225)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 0\
**Last updated:** [April 10, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/testing-a-gem-outside-the-rails-framework/165225 "2009-04-10T12:35:54Z")

</div>

I’m writing an acts\_as\_something gem for ActiveRecord. I want to test it only on the ActiveRecord part of the framework. Therefore I’m not loading the entire rails framework, only ActiveRecord. That’s all fine but I n…

---

## [Rails on westhost.com](https://www.ruby-forum.com/t/rails-on-westhost-com/165147)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [April 10, 2009, 12:19pm UTC](https://www.ruby-forum.com/t/rails-on-westhost-com/165147 "2009-04-10T12:19:40Z")

</div>

I have an account on westhost, but they are at rails version 1.2.3 I did a 'gem install rails -v=2.2.2 That seem to work. The output of gem list is: \*\*\* LOCAL GEMS \*\*\* actionmailer (2.2.2, 1.3.3) actionpack (2.2.2,…

---

## [Join query in rails](https://www.ruby-forum.com/t/join-query-in-rails/165132)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 8\
**Last updated:** [April 10, 2009, 11:46am UTC](https://www.ruby-forum.com/t/join-query-in-rails/165132 "2009-04-10T11:46:32Z")

</div>

Hi… how i should write the below query in rails.i found through mysql tutorial.i m not pro in rails …so give some lights… SELECT \* FROM contactinfo join userinfo on contactinfo.contact\_id = userinfo.id where contacti…

---

## [Code open the external links in new tab, or new window](https://www.ruby-forum.com/t/code-open-the-external-links-in-new-tab-or-new-window/165218)

<div class="topic-metadata">

**Author:** [@santoshturamari](https://www.ruby-forum.com/u/santoshturamari)\
**Replies:** 0\
**Last updated:** [April 10, 2009, 9:58am UTC](https://www.ruby-forum.com/t/code-open-the-external-links-in-new-tab-or-new-window/165218 "2009-04-10T09:58:20Z")

</div>

Hi all, I have a problem to open an add in my app in new tab, it is opening in the same tab of my site. in my view I have added \<%= show\_industry\_sponsor(@community.industry) %\> and in application\_helper.rb def sho…

---

## [Validating a date is a Monday](https://www.ruby-forum.com/t/validating-a-date-is-a-monday/165213)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 3\
**Last updated:** [April 10, 2009, 9:40am UTC](https://www.ruby-forum.com/t/validating-a-date-is-a-monday/165213 "2009-04-10T09:40:33Z")

</div>

I’m trying to do this… def validate errors.add\_to\_base "requested start date must be a monday" if requested\_start\_date != Chronic.parse(‘monday’) end Not working though - this fails vaildation all the time (regardl…

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

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