# Rails

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

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

---

## [How to Have Constants Available Throughout App?](https://www.ruby-forum.com/t/how-to-have-constants-available-throughout-app/141242)

<div class="topic-metadata">

**Author:** [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Replies:** 3\
**Last updated:** [June 24, 2008, 1:51am UTC](https://www.ruby-forum.com/t/how-to-have-constants-available-throughout-app/141242 "2008-06-24T01:51:47Z")

</div>

I discovered that you can add these modules under /lib with constants in them and call these constants like so : module AdminConstants email =‘removed\_email\_address@domain.invalid’ phone =“123456789” end and then a…

---

## [Login Generator Error](https://www.ruby-forum.com/t/login-generator-error/140988)

<div class="topic-metadata">

**Author:** [@frozzare](https://www.ruby-forum.com/u/frozzare)\
**Replies:** 3\
**Last updated:** [June 24, 2008, 1:45am UTC](https://www.ruby-forum.com/t/login-generator-error/140988 "2008-06-24T01:45:13Z")

</div>

Hi. I have install the Login Generator, but i get a error. NoMethodError undefined method \`model’ for ApplicationController:Class require\_dependency “login\_system” class ApplicationController \< ActionController::Bas…

---

## [Updating to 2.1.0 using InstantRails2.0 - cache problem](https://www.ruby-forum.com/t/updating-to-2-1-0-using-instantrails2-0-cache-problem/141233)

<div class="topic-metadata">

**Author:** [@ppjunty](https://www.ruby-forum.com/u/ppjunty)\
**Replies:** 1\
**Last updated:** [June 24, 2008, 12:05am UTC](https://www.ruby-forum.com/t/updating-to-2-1-0-using-instantrails2-0-cache-problem/141233 "2008-06-24T00:05:48Z")

</div>

hello. i’m trying to update to rails 2.1 using instant rails, so i can use the new cache features, but when i try to use the method “Rails.cache.write” in a controller, i get the error “undefined method \`cache’ for …

---

## [How to Load Data Into DB](https://www.ruby-forum.com/t/how-to-load-data-into-db/141215)

<div class="topic-metadata">

**Author:** [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Replies:** 5\
**Last updated:** [June 23, 2008, 10:19pm UTC](https://www.ruby-forum.com/t/how-to-load-data-into-db/141215 "2008-06-23T22:19:38Z")

</div>

Is there a way of automatically initializing a database with sample data? I ask because fixtures seems to be geared towards the test database (different from the development version) and that too it loads one table at…

---

## [Javascript in Action as onload](https://www.ruby-forum.com/t/javascript-in-action-as-onload/141231)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/javascript-in-action-as-onload/141231 "2008-06-23T22:03:35Z")

</div>

Can I run a javascript in an action like as onload and not AJAX?

---

## [Design Pattern for Recurring Events](https://www.ruby-forum.com/t/design-pattern-for-recurring-events/141216)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 9:12pm UTC](https://www.ruby-forum.com/t/design-pattern-for-recurring-events/141216 "2008-06-23T21:12:12Z")

</div>

Not specifically a rails question, so forgive me… How would people recommend representing recurring events in a rails application? Are there any established design patterns? ~ Mark

---

## [Online or not?](https://www.ruby-forum.com/t/online-or-not/141209)

<div class="topic-metadata">

**Author:** [@teenage](https://www.ruby-forum.com/u/teenage)\
**Replies:** 2\
**Last updated:** [June 23, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/online-or-not/141209 "2008-06-23T20:11:47Z")

</div>

Hey, I’m using this to see who’s online on a intranet site at work. def get\_online\_users sessions = CGI::Session::ActiveRecordStore::Session.find(:all, :conditions =\> \[“updated\_at \>= ?”, 30.minutes.ago\]) user\_ids = …

---

## [Open ID Install the ruby-openid gem to enable OpenID support](https://www.ruby-forum.com/t/open-id-install-the-ruby-openid-gem-to-enable-openid-support/141220)

<div class="topic-metadata">

**Author:** [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/open-id-install-the-ruby-openid-gem-to-enable-openid-support/141220 "2008-06-23T20:05:48Z")

</div>

I have installed “sudo gem install ruby-openid” successfully then installed the plugin. “script/plugin install http://svn.rubyonrails.org/rails/plugins/open\_id\_authentication/” the error i get is “no such file to loa…

---

## [Error loading fixtures for classes that set\_table\_name](https://www.ruby-forum.com/t/error-loading-fixtures-for-classes-that-set-table-name/196722)

<div class="topic-metadata">

**Author:** [@bcm](https://www.ruby-forum.com/u/bcm)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 6:11pm UTC](https://www.ruby-forum.com/t/error-loading-fixtures-for-classes-that-set-table-name/196722 "2008-06-23T18:11:45Z")

</div>

Hi all, I just hit a big wall involving a legacy database. I’ve got an active record class called “School” that uses “set\_table\_name ‘old\_school’” to map to a legacy database table: class School \< ActiveRecord::Base …

---

## [Insert data to the databse](https://www.ruby-forum.com/t/insert-data-to-the-databse/141197)

<div class="topic-metadata">

**Author:** [@soutom](https://www.ruby-forum.com/u/soutom)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 6:07pm UTC](https://www.ruby-forum.com/t/insert-data-to-the-databse/141197 "2008-06-23T18:07:27Z")

</div>

how can i insert data to the database from any controller

---

## [Rails Routing](https://www.ruby-forum.com/t/rails-routing/141211)

<div class="topic-metadata">

**Author:** [@Jeff\_Lee](https://www.ruby-forum.com/u/Jeff_Lee)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 5:59pm UTC](https://www.ruby-forum.com/t/rails-routing/141211 "2008-06-23T17:59:49Z")

</div>

I have a profiles controller and added a method named student\_add. I would like to access this method via: http://localhost/profiles/add/student However, when I add the route "map.connect ‘profiles/student/ add’, :co…

---

## [\[ANN\] ClassyInheritance 0.4.0](https://www.ruby-forum.com/t/ann-classyinheritance-0-4-0/141208)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/ann-classyinheritance-0-4-0/141208 "2008-06-23T17:00:30Z")

</div>

About: http://stonean.com/wiki/classy-inheritance Classy Inheritance simplifies the definition and implementation of one object depending on another object. For example, a User object depending on a Person object. …

---

## [Messaging system](https://www.ruby-forum.com/t/messaging-system/141181)

<div class="topic-metadata">

**Author:** [@teenage](https://www.ruby-forum.com/u/teenage)\
**Replies:** 2\
**Last updated:** [June 23, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/messaging-system/141181 "2008-06-23T16:57:21Z")

</div>

Hey All, I’m trying to put a messaging system together using this http://www.novawave.net/public/rails\_messaging\_tutorial.html. All working fine but I’d like to be to thread the replies. At the moment, a message goes…

---

## [Plugin problems: "simply\_helpful"](https://www.ruby-forum.com/t/plugin-problems-simply-helpful/141190)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 8\
**Last updated:** [June 23, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/plugin-problems-simply-helpful/141190 "2008-06-23T16:37:32Z")

</div>

I read at http://matthewman.net/2006/09/04/new-rails-feature-simply\_helpful/ that “simply\_helpful” would introduce a new syntax for the form\_for helper. But even though the plugin is installed (I know that because the…

---

## [What skills do you need for Ruby On Rails?](https://www.ruby-forum.com/t/what-skills-do-you-need-for-ruby-on-rails/141076)

<div class="topic-metadata">

**Author:** [@jmDesktop](https://www.ruby-forum.com/u/jmDesktop)\
**Replies:** 4\
**Last updated:** [June 23, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/what-skills-do-you-need-for-ruby-on-rails/141076 "2008-06-23T16:19:17Z")

</div>

Hi, I know that may have an obvious answer, but as far as running rails is concerned, what skillset would an experienced web application developer need to start using RoR? This assumes I understand OOP/D and MVC desi…

---

## [Rails 2.0: How to enforce upcase in new & edit methods](https://www.ruby-forum.com/t/rails-2-0-how-to-enforce-upcase-in-new-edit-methods/141167)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 9\
**Last updated:** [June 23, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/rails-2-0-how-to-enforce-upcase-in-new-edit-methods/141167 "2008-06-23T16:17:53Z")

</div>

Hi, I generated a Ruby 2.0 app and created a Portfolio model with two data items: symbol:string name:string. The default ACID functions work fine. But I want to add constraints one the New and Edit functions for s…

---

## [Pretty resource links with arguments](https://www.ruby-forum.com/t/pretty-resource-links-with-arguments/141203)

<div class="topic-metadata">

**Author:** [@arvias](https://www.ruby-forum.com/u/arvias)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/pretty-resource-links-with-arguments/141203 "2008-06-23T16:15:10Z")

</div>

Hi, I have a resource where an action needs an extra argument. link\_to ‘message’, action\_resource\_path(:argument =\> ‘something’) creates a link: /resource/action?argument=something. In order to make this appear like…

---

## [Pretty resource links with arguments](https://www.ruby-forum.com/t/pretty-resource-links-with-arguments/196720)

<div class="topic-metadata">

**Author:** [@arvias](https://www.ruby-forum.com/u/arvias)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/pretty-resource-links-with-arguments/196720 "2008-06-23T16:15:09Z")

</div>

Hi, I have a resource where an action needs an extra argument. link\_to ‘message’, action\_resource\_path(:argument =\> ‘something’) creates a link: /resource/action?argument=something. In order to make this appear like…

---

## [Gem install rails](https://www.ruby-forum.com/t/gem-install-rails/141145)

<div class="topic-metadata">

**Author:** [@hector](https://www.ruby-forum.com/u/hector)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/gem-install-rails/141145 "2008-06-23T15:52:51Z")

</div>

May be it is a question of rem or rubye$B!$e(Bbut I need your help. When I use gem install rails,it fails.But I use the same command,it passed in another computer. OK. I use hector@hector-laptop:~$ sudo gem install r…

---

## [Session\[:\] variables](https://www.ruby-forum.com/t/session-variables/141194)

<div class="topic-metadata">

**Author:** [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Replies:** 4\
**Last updated:** [June 23, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/session-variables/141194 "2008-06-23T15:08:25Z")

</div>

hi all, i would like to know how safe is to use session variables like session\[:name\]=something? can it be tampered by the user or somebody? can we have it in methods in application.rb and application\_helper.rb for s…

---

## [Need Help on How to provide a Start and Stop Date range Dynamically to my ActiveRecord Find?](https://www.ruby-forum.com/t/need-help-on-how-to-provide-a-start-and-stop-date-range-dynamically-to-my-activerecord-find/140948)

<div class="topic-metadata">

**Author:** [@scottc12](https://www.ruby-forum.com/u/scottc12)\
**Replies:** 4\
**Last updated:** [June 23, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/need-help-on-how-to-provide-a-start-and-stop-date-range-dynamically-to-my-activerecord-find/140948 "2008-06-23T15:05:49Z")

</div>

I’d like to have my index page present the user with a Form for selecting a Date range Example: Start 2008-06-19 End: 2008-06-29 and then pass this information into my ActiveRecord Find I’m working with a legacy DB…

---

## [How to Put Form Buttons In PDFs](https://www.ruby-forum.com/t/how-to-put-form-buttons-in-pdfs/141199)

<div class="topic-metadata">

**Author:** [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 2:40pm UTC](https://www.ruby-forum.com/t/how-to-put-form-buttons-in-pdfs/141199 "2008-06-23T14:40:50Z")

</div>

So I am using pdf :: writer for creating pdf files. I would like them to be printable but NOT viewable. The workaround I was told of was this : create a button the size of a page filled in with black ; set the button …

---

## [Secure login with rails?](https://www.ruby-forum.com/t/secure-login-with-rails/141188)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 2:13pm UTC](https://www.ruby-forum.com/t/secure-login-with-rails/141188 "2008-06-23T14:13:25Z")

</div>

Hi- Is there an easy plugin or something that will allow secure login in Rails? I’d be interested in enabling secure login for both both post and Ajax login. Hoping someone can just give me a push in the right dire…

---

## [Roo gem](https://www.ruby-forum.com/t/roo-gem/141196)

<div class="topic-metadata">

**Author:** [@kisrti](https://www.ruby-forum.com/u/kisrti)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 1:55pm UTC](https://www.ruby-forum.com/t/roo-gem/141196 "2008-06-23T13:55:06Z")

</div>

Hello, I have simple rails application using ‘roo gem’ to import data from xls file and store that data into database. The code is working fine, But my issue is that when i am trying to import file with 64,000 rows,p…

---

## [NoMethodError on functional test -](https://www.ruby-forum.com/t/nomethoderror-on-functional-test/196719)

<div class="topic-metadata">

**Author:** [@eddy\_b](https://www.ruby-forum.com/u/eddy_b)\
**Replies:** 3\
**Last updated:** [June 23, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/nomethoderror-on-functional-test/196719 "2008-06-23T13:26:51Z")

</div>

Hi, I’ve got a small problem with my funcional tests. I want to test the function, that anybody who wants to the admin - controller redirect to the authentication - controller. So I write this small test: def test\_in…

---

## ['ArgumentError: bad value for range' for range of Times](https://www.ruby-forum.com/t/argumenterror-bad-value-for-range-for-range-of-times/141182)

<div class="topic-metadata">

**Author:** [@David\_Bird](https://www.ruby-forum.com/u/David_Bird)\
**Replies:** 2\
**Last updated:** [June 23, 2008, 12:27pm UTC](https://www.ruby-forum.com/t/argumenterror-bad-value-for-range-for-range-of-times/141182 "2008-06-23T12:27:00Z")

</div>

Hi, When using the calendar\_date\_select plugin, Rails kept throwing an ArgumentError: ‘bad value for range’, but only on Windows (fine on OSX). Playing around in the console I get… 38.years.ago…10.years.ago =\> Tue…

---

## [NoMethodError on functional test](https://www.ruby-forum.com/t/nomethoderror-on-functional-test/141178)

<div class="topic-metadata">

**Author:** [@eddy\_b](https://www.ruby-forum.com/u/eddy_b)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 11:48am UTC](https://www.ruby-forum.com/t/nomethoderror-on-functional-test/141178 "2008-06-23T11:48:16Z")

</div>

Hi, I’ve got a small problem with my funcional tests. I want to test the function, that anybody who wants to the admin - controller redirect to the authentication - controller. So I write this small test: def test\_in…

---

## [Actioncontroller- How the routes be choosen](https://www.ruby-forum.com/t/actioncontroller-how-the-routes-be-choosen/141179)

<div class="topic-metadata">

**Author:** [@zhonghaijun](https://www.ruby-forum.com/u/zhonghaijun)\
**Replies:** 0\
**Last updated:** [June 23, 2008, 10:32am UTC](https://www.ruby-forum.com/t/actioncontroller-how-the-routes-be-choosen/141179 "2008-06-23T10:32:36Z")

</div>

Hi, I am looking at the source code of resource.rb and have a question for the code below: ===========Ruby script resource.rb ======================= map.named\_route("#{action}#{resource.name\_prefix}#{resource.singul…

---

## [How to read & render a text file?](https://www.ruby-forum.com/t/how-to-read-render-a-text-file/141173)

<div class="topic-metadata">

**Author:** [@donvito](https://www.ruby-forum.com/u/donvito)\
**Replies:** 1\
**Last updated:** [June 23, 2008, 9:04am UTC](https://www.ruby-forum.com/t/how-to-read-render-a-text-file/141173 "2008-06-23T09:04:54Z")

</div>

Hello Everyone. There is a method withing controller which is supposed to read a text file puts its content into the output Problem: Output shows up in console window while not showing in html output. Method itself…

---

## [Pagination undefined method \`total\_pages'](https://www.ruby-forum.com/t/pagination-undefined-method-total-pages/141152)

<div class="topic-metadata">

**Author:** [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Replies:** 8\
**Last updated:** [June 23, 2008, 9:02am UTC](https://www.ruby-forum.com/t/pagination-undefined-method-total-pages/141152 "2008-06-23T09:02:34Z")

</div>

I tried to use the gem will\_paginate but it doesn’t work as describs in manual Controller def index @sites = Site.paginate :per\_page =\> 10, :page =\> params\[:page\] end View \<% for @sites in @sites %\> \<%= @sites.na…

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

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