# Rails

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

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

---

## [Using route resource in the model](https://www.ruby-forum.com/t/using-route-resource-in-the-model/127254)

<div class="topic-metadata">

**Author:** [@Chubbs](https://www.ruby-forum.com/u/Chubbs)\
**Replies:** 2\
**Last updated:** [January 27, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/using-route-resource-in-the-model/127254 "2008-01-27T15:41:24Z")

</div>

How would i go about using a mapped resource in my model? eg. routes file map.resources :questions model def after\_create notification = UserNotification.new(:user =\> current\_user) notification.body = ‘You posted a …

---

## [Different view for desktop and mobile browser](https://www.ruby-forum.com/t/different-view-for-desktop-and-mobile-browser/127231)

<div class="topic-metadata">

**Author:** [@pph](https://www.ruby-forum.com/u/pph)\
**Replies:** 3\
**Last updated:** [January 27, 2008, 3:10pm UTC](https://www.ruby-forum.com/t/different-view-for-desktop-and-mobile-browser/127231 "2008-01-27T15:10:35Z")

</div>

Hi, I am just beginning with RoR and I need to add into existing RoR application version for mobile device-concretely iPhone. I need to change layer for it and a lot of view because I need different display on the iP…

---

## [Validating if record exists by name](https://www.ruby-forum.com/t/validating-if-record-exists-by-name/127262)

<div class="topic-metadata">

**Author:** [@Chubbs](https://www.ruby-forum.com/u/Chubbs)\
**Replies:** 3\
**Last updated:** [January 27, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/validating-if-record-exists-by-name/127262 "2008-01-27T15:02:59Z")

</div>

hey guys, i have looked alot of places and seen screencasts on validation but i still dont understand how to go about validating a form to check if the record exists by the name entered in. lets say a project, has us…

---

## [Active record position](https://www.ruby-forum.com/t/active-record-position/127244)

<div class="topic-metadata">

**Author:** [@flnative](https://www.ruby-forum.com/u/flnative)\
**Replies:** 3\
**Last updated:** [January 27, 2008, 12:36pm UTC](https://www.ruby-forum.com/t/active-record-position/127244 "2008-01-27T12:36:22Z")

</div>

Hi @ all How can I find out the number of the position of a record in the database? i.e: id firstname 2 bryan -\> that’s position 1 5 silvester -\> that’s position 2 19 michael …

---

## [Trying to find where Java "JRE" is located on Ubuntu 7.10 machine?](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [January 27, 2008, 12:06pm UTC](https://www.ruby-forum.com/t/trying-to-find-where-java-jre-is-located-on-ubuntu-7-10-machine/196571 "2008-01-27T12:06:56Z")

</div>

I’ve spent the last year developing a large Ruby on Rails 2.0 application with over a 100 tables and controllers and hope to be deploying it soon. Before I moved from my Windows XP computer to deployment, I wanted to …

---

## [Empty Model creates DangerousAttributeError and connection is defined by ActiveRecord](https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229)

<div class="topic-metadata">

**Author:** [@dgo](https://www.ruby-forum.com/u/dgo)\
**Replies:** 2\
**Last updated:** [January 27, 2008, 11:29am UTC](https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229 "2008-01-27T11:29:50Z")

</div>

Dear list, The following situation drives me crazy. I have one model called AlumniMember and one AlumniData. Both filled with code. I developed both on Rails 1.2.3. Now I update the App to Rails 2.0.2. Now the follow…

---

## [Expiring Cache from Models](https://www.ruby-forum.com/t/expiring-cache-from-models/127056)

<div class="topic-metadata">

**Author:** [@cghawthorne](https://www.ruby-forum.com/u/cghawthorne)\
**Replies:** 8\
**Last updated:** [January 27, 2008, 11:28am UTC](https://www.ruby-forum.com/t/expiring-cache-from-models/127056 "2008-01-27T11:28:03Z")

</div>

Hi, Is it possible to expire cache items (page, action, or fragment) from within a model? I know that sweepers let you trigger cache expiration on model changes, but they have to be activated in the controller. I wa…

---

## [\[ANN\] multi\_rails 0.0.5 Released](https://www.ruby-forum.com/t/ann-multi-rails-0-0-5-released/127264)

<div class="topic-metadata">

**Author:** [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Replies:** 0\
**Last updated:** [January 27, 2008, 10:57am UTC](https://www.ruby-forum.com/t/ann-multi-rails-0-0-5-released/127264 "2008-01-27T10:57:30Z")

</div>

multi\_rails version 0.0.5 has been released! MultiRails by Relevance, http://thinkrelevance.com Rob S. - MultiRails lead MultiRails lets you test your Rails plugin or app against many versions of Rails in one swee…

---

## [Testing without a test database](https://www.ruby-forum.com/t/testing-without-a-test-database/127169)

<div class="topic-metadata">

**Author:** [@bcm](https://www.ruby-forum.com/u/bcm)\
**Replies:** 1\
**Last updated:** [January 27, 2008, 10:46am UTC](https://www.ruby-forum.com/t/testing-without-a-test-database/127169 "2008-01-27T10:46:55Z")

</div>

Hi all, I’m working on a very large, very complex legacy database (Oracle, \> 4GB of text data in 1000s of tables). For this situation, dropping tables and populating them from fixtures just isn’t feasible: I can’t lo…

---

## [How to know if model attribute is protected?](https://www.ruby-forum.com/t/how-to-know-if-model-attribute-is-protected/127252)

<div class="topic-metadata">

**Author:** [@Kip](https://www.ruby-forum.com/u/Kip)\
**Replies:** 1\
**Last updated:** [January 27, 2008, 4:45am UTC](https://www.ruby-forum.com/t/how-to-know-if-model-attribute-is-protected/127252 "2008-01-27T04:45:25Z")

</div>

I’m adding some meta-methods to a plugin and would really like to be able to know if an attribute is protected or not in my model. Unusually, googing hasn’t turned up an answer. I know I could try an assignment and…

---

## [Best practice on invoking stale sessions cleanup?](https://www.ruby-forum.com/t/best-practice-on-invoking-stale-sessions-cleanup/127242)

<div class="topic-metadata">

**Author:** [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Replies:** 4\
**Last updated:** [January 27, 2008, 3:26am UTC](https://www.ruby-forum.com/t/best-practice-on-invoking-stale-sessions-cleanup/127242 "2008-01-27T03:26:39Z")

</div>

I’ve found a few refs to a bit of code to cleanup stale sessions. In my ignorance, I’m not sure what the best practice is for invoking this process. Some talk about a cron job, others say to call it from a frequently …

---

## [Rails 2.0 error ActiveRecord handling/reporting best practice](https://www.ruby-forum.com/t/rails-2-0-error-activerecord-handling-reporting-best-practice/127251)

<div class="topic-metadata">

**Author:** [@acampos](https://www.ruby-forum.com/u/acampos)\
**Replies:** 1\
**Last updated:** [January 27, 2008, 3:02am UTC](https://www.ruby-forum.com/t/rails-2-0-error-activerecord-handling-reporting-best-practice/127251 "2008-01-27T03:02:38Z")

</div>

I’ve included rescue\_from ActiveRecord::RecordNotFound in my application.rb file in order to catch and report all failed ActiveRecord find operations. However, ActiveRecord does not raise this exception from the dyn…

---

## [ReXML & to\_json](https://www.ruby-forum.com/t/rexml-to-json/127116)

<div class="topic-metadata">

**Author:** [@stubbsuk](https://www.ruby-forum.com/u/stubbsuk)\
**Replies:** 4\
**Last updated:** [January 27, 2008, 1:47am UTC](https://www.ruby-forum.com/t/rexml-to-json/127116 "2008-01-27T01:47:50Z")

</div>

Does REXML support to\_json? I keep getting “object references itself” when I do this (simplified version): xml = Document.new("\<root\>\<ooh fert='nerdle'\>Narf!\</ooh\>\</root\>") @json = xml.to\_json Is it possible to outpu…

---

## [Restful\_authentication: getting error when trying to login](https://www.ruby-forum.com/t/restful-authentication-getting-error-when-trying-to-login/126948)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [January 27, 2008, 12:42am UTC](https://www.ruby-forum.com/t/restful-authentication-getting-error-when-trying-to-login/126948 "2008-01-27T00:42:05Z")

</div>

Hi, After downloading the restful\_authentication plugin, I have the following in my config/routes.rb file: map.signup ‘/signup’, :controller =\> ‘users’, :action =\> ‘new’ map.login ‘/login’, :controller =\> ‘session’,…

---

## ["Expected #{RAILS\_ROOT}/vendor/plugins/acts\_as\_ferret/lib/class\_methods.rb to define ClassMethods e](https://www.ruby-forum.com/t/expected-rails-root-vendor-plugins-acts-as-ferret-lib-class-methods-rb-to-define-classmethods-e/127236)

<div class="topic-metadata">

**Author:** [@bbennett](https://www.ruby-forum.com/u/bbennett)\
**Replies:** 1\
**Last updated:** [January 26, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/expected-rails-root-vendor-plugins-acts-as-ferret-lib-class-methods-rb-to-define-classmethods-e/127236 "2008-01-26T21:51:49Z")

</div>

Hi, I struggled with this error: "Expected #{RAILS\_ROOT}/vendor/plugins/acts\_as\_ferret/lib/ class\_methods.rb to define ClassMethods for a while after upgrading from rails 1.2.3 to 2.0.2, and although I seem to have …

---

## [Logger broken?](https://www.ruby-forum.com/t/logger-broken/127240)

<div class="topic-metadata">

**Author:** [@truchty](https://www.ruby-forum.com/u/truchty)\
**Replies:** 0\
**Last updated:** [January 26, 2008, 9:22pm UTC](https://www.ruby-forum.com/t/logger-broken/127240 "2008-01-26T21:22:34Z")

</div>

Hi guys, Up until yesterday, the rails logger was working (typed logger.info in controllers and views). Today, it is not outputting anything at all. Not just my commands, but the SQL commands that rails shows to help …

---

## [Rake aborted.. Mysql error](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211)

<div class="topic-metadata">

**Author:** [@stranger](https://www.ruby-forum.com/u/stranger)\
**Replies:** 3\
**Last updated:** [January 26, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211 "2008-01-26T18:35:34Z")

</div>

Hi, I am following a tutorial using the acts\_as\_authenticated plugin. I created a new project and created a controller today and then installed the authentication plugin. I ran the rake db:migrate. == CreateUsers: mi…

---

## [Handling two models in one form](https://www.ruby-forum.com/t/handling-two-models-in-one-form/127227)

<div class="topic-metadata">

**Author:** [@zoopzoop](https://www.ruby-forum.com/u/zoopzoop)\
**Replies:** 2\
**Last updated:** [January 26, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/handling-two-models-in-one-form/127227 "2008-01-26T18:31:05Z")

</div>

I am just beginning with RoR and ran into my first major headscratcher. I have a model “events” which is through “has\_and\_belongs\_to\_many” (habtm) connected to a model “event\_types”, meaning one event can have several…

---

## [Error: no such file to load -- geokit (plugin is install)](https://www.ruby-forum.com/t/error-no-such-file-to-load-geokit-plugin-is-install/127232)

<div class="topic-metadata">

**Author:** [@mcrj45](https://www.ruby-forum.com/u/mcrj45)\
**Replies:** 0\
**Last updated:** [January 26, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/error-no-such-file-to-load-geokit-plugin-is-install/127232 "2008-01-26T17:57:27Z")

</div>

Hi, after spending hours on getting geokit and ym4r running I don’t know how to do or how to getting a test running. I have try the tutorial from http://www.railslodge.com/plugins/179-ym4r but I don’t get it :(. Has …

---

## [Previewing a post with an attachment\_fu image](https://www.ruby-forum.com/t/previewing-a-post-with-an-attachment-fu-image/127210)

<div class="topic-metadata">

**Author:** [@rubynuby](https://www.ruby-forum.com/u/rubynuby)\
**Replies:** 2\
**Last updated:** [January 26, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/previewing-a-post-with-an-attachment-fu-image/127210 "2008-01-26T17:50:03Z")

</div>

I want to allow the user to preview the posts they’re making. Easy enough to do with text and a single model. However, now I want to allow posting of (multiple) attachments per post. My models: class Post \< ActiveR…

---

## [Rails \<selection\>, config.yml etc](https://www.ruby-forum.com/t/rails-selection-config-yml-etc/127226)

<div class="topic-metadata">

**Author:** [@casid](https://www.ruby-forum.com/u/casid)\
**Replies:** 0\
**Last updated:** [January 26, 2008, 4:18pm UTC](https://www.ruby-forum.com/t/rails-selection-config-yml-etc/127226 "2008-01-26T16:18:39Z")

</div>

Actually I have more than one question, If you give me some advice or idea I will be really happy. I m newbie on using Ruby. I have just stared writing program with ruby and ruby on rails. fist I want to ask about pre…

---

## [Problem with SQl statement/query](https://www.ruby-forum.com/t/problem-with-sql-statement-query/127223)

<div class="topic-metadata">

**Author:** [@MarcHoeppner](https://www.ruby-forum.com/u/MarcHoeppner)\
**Replies:** 0\
**Last updated:** [January 26, 2008, 3:10pm UTC](https://www.ruby-forum.com/t/problem-with-sql-statement-query/127223 "2008-01-26T15:10:31Z")

</div>

Hi all, I have some difficulties putting together a query using four tables, maybe someone can help me out on how to write the code: table: organisms (id, organism) 1 Organism1 2 Organism2 3 Organism3 and so on… t…

---

## [Association preloading problems](https://www.ruby-forum.com/t/association-preloading-problems/127219)

<div class="topic-metadata">

**Author:** [@fcheung](https://www.ruby-forum.com/u/fcheung)\
**Replies:** 1\
**Last updated:** [January 26, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/association-preloading-problems/127219 "2008-01-26T13:41:22Z")

</div>

first off there are some patches on http://dev.rubyonrails.org/attachment/ticket/9640 that look sane to me (and maybe have slipped under the radar because they weren’t in their own ticket). Secondly it has been ver…

---

## [Which debugger to be using](https://www.ruby-forum.com/t/which-debugger-to-be-using/127197)

<div class="topic-metadata">

**Author:** [@petem](https://www.ruby-forum.com/u/petem)\
**Replies:** 1\
**Last updated:** [January 26, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/which-debugger-to-be-using/127197 "2008-01-26T13:26:42Z")

</div>

irb, ruby-debug,rdb,rdebug … gee? Which is the stable debuger we should be using lately?

---

## [Undefined method save](https://www.ruby-forum.com/t/undefined-method-save/127209)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 1\
**Last updated:** [January 26, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/undefined-method-save/127209 "2008-01-26T13:26:07Z")

</div>

I have this app that is supposed to take as input several parts of a blog entry and save it in a table. I did the migration to create the tables and the created a partial for the form to enter the data. I hit the subm…

---

## [Rails and Enterprise Applications](https://www.ruby-forum.com/t/rails-and-enterprise-applications/127183)

<div class="topic-metadata">

**Author:** [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Replies:** 6\
**Last updated:** [January 26, 2008, 10:20am UTC](https://www.ruby-forum.com/t/rails-and-enterprise-applications/127183 "2008-01-26T10:20:40Z")

</div>

Hi Everyone: My company is looking to migrate one of their enterprise-class products to Ruby on Rails, and there are some questions from the highest levels of management about what we’re doing. So, my question to the…

---

## [Restful multi button form](https://www.ruby-forum.com/t/restful-multi-button-form/125983)

<div class="topic-metadata">

**Author:** [@Chubbs](https://www.ruby-forum.com/u/Chubbs)\
**Replies:** 3\
**Last updated:** [January 26, 2008, 10:10am UTC](https://www.ruby-forum.com/t/restful-multi-button-form/125983 "2008-01-26T10:10:58Z")

</div>

Hey, I have a controller messages which for the index action lists messages. I want buttons to be able to serve actions “mark\_read” and “delete”. how do i create my form to be able to submit the buttons without it …

---

## [Page generate from table/array?](https://www.ruby-forum.com/t/page-generate-from-table-array/127158)

<div class="topic-metadata">

**Author:** [@miked](https://www.ruby-forum.com/u/miked)\
**Replies:** 1\
**Last updated:** [January 26, 2008, 7:11am UTC](https://www.ruby-forum.com/t/page-generate-from-table-array/127158 "2008-01-26T07:11:25Z")

</div>

Hi: Does anyone know of a gem that will generate an html table from an array? Thanks! Mike

---

## [\[ANN\] Join us for Vancouver's 1st RubyCamp this Saturday from 9-5](https://www.ruby-forum.com/t/ann-join-us-for-vancouvers-1st-rubycamp-this-saturday-from-9-5/127208)

<div class="topic-metadata">

**Author:** [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Replies:** 0\
**Last updated:** [January 26, 2008, 5:58am UTC](https://www.ruby-forum.com/t/ann-join-us-for-vancouvers-1st-rubycamp-this-saturday-from-9-5/127208 "2008-01-26T05:58:25Z")

</div>

Hello, First a big thanks to our prime sponsor Engine Y. (http:// engineyard.com) and our supporting sponsor ActiveState (http:// activestate.com) for helping us with the rental fee at WorkSpace and supporting Vancou…

---

## [Funny characters in file names](https://www.ruby-forum.com/t/funny-characters-in-file-names/127203)

<div class="topic-metadata">

**Author:** [@anti](https://www.ruby-forum.com/u/anti)\
**Replies:** 1\
**Last updated:** [January 26, 2008, 5:39am UTC](https://www.ruby-forum.com/t/funny-characters-in-file-names/127203 "2008-01-26T05:39:44Z")

</div>

def file\_tail (file, offset) 56 f=File.new(file) f.seek(-offset,IO::SEEK\_END) f.read end def get\_tags file file\_tail(file, 128) end using these def to get ID3 data works well till it encounters this Äîðîãàÿï…

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

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