# Rails

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

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

---

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

<div class="topic-metadata">

**Author:** [@engamocap](https://www.ruby-forum.com/u/engamocap)\
**Replies:** 3\
**Last updated:** [March 17, 2009, 10:42am UTC](https://www.ruby-forum.com/t/will-paginate/163002 "2009-03-17T10:42:50Z")

</div>

I have this problem: user can select some params from a form: \<% form\_tag({:action =\> “view”}, :method =\> “get”, :target =\> “\_blank”) do %\> … \<% end %\> In method view of controller: … @items = Item.paginate :all, …

---

## [Khim sreang wants to chat](https://www.ruby-forum.com/t/khim-sreang-wants-to-chat/163090)

<div class="topic-metadata">

**Author:** [@khim\_sreang](https://www.ruby-forum.com/u/khim_sreang)\
**Replies:** 0\
**Last updated:** [March 17, 2009, 10:41am UTC](https://www.ruby-forum.com/t/khim-sreang-wants-to-chat/163090 "2009-03-17T10:41:05Z")

</div>

khim sreang wants to stay in better touch using some of Google’s coolest new products. If you already have Gmail or Google Talk, visit: You’ll need to click this link to be able to chat with khim sreang. To get Gm…

---

## [Reading log summary line from log file](https://www.ruby-forum.com/t/reading-log-summary-line-from-log-file/163080)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 6\
**Last updated:** [March 17, 2009, 10:27am UTC](https://www.ruby-forum.com/t/reading-log-summary-line-from-log-file/163080 "2009-03-17T10:27:36Z")

</div>

I am trying to understand the last line from an action log in development mode. I have the following line and understand the view and DB as the length of time it takes to process the view and the db access. But what i…

---

## [Attachment\_fu doesnt resize photo and create thumbnails](https://www.ruby-forum.com/t/attachment-fu-doesnt-resize-photo-and-create-thumbnails/163075)

<div class="topic-metadata">

**Author:** [@tkbeili](https://www.ruby-forum.com/u/tkbeili)\
**Replies:** 5\
**Last updated:** [March 17, 2009, 10:16am UTC](https://www.ruby-forum.com/t/attachment-fu-doesnt-resize-photo-and-create-thumbnails/163075 "2009-03-17T10:16:25Z")

</div>

Hello, I’m trying to use attachment\_fu in order to upload photo and create three versions of thumbnails (large small and medium). This works perfect of my mac book. but on my production server it uploads the image bu…

---

## [Capistrano error: not allowed to execute '/usr/bin/nohup script/spin'](https://www.ruby-forum.com/t/capistrano-error-not-allowed-to-execute-usr-bin-nohup-script-spin/162949)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 4\
**Last updated:** [March 17, 2009, 9:06am UTC](https://www.ruby-forum.com/t/capistrano-error-not-allowed-to-execute-usr-bin-nohup-script-spin/162949 "2009-03-17T09:06:43Z")

</div>

I get the error that my assigned user isn’t allowed to execute script/ spin. I checked in my current/ directory and there is no script/spin file.

---

## [Caching in Rails](https://www.ruby-forum.com/t/caching-in-rails/163082)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 1\
**Last updated:** [March 17, 2009, 8:07am UTC](https://www.ruby-forum.com/t/caching-in-rails/163082 "2009-03-17T08:07:19Z")

</div>

I have a page that requires a lot of DB access to create a section of it, but that section does not change very often. I know how to cache the fragment in the view, but the db is still accessed in the controller. I wa…

---

## [Git branch with same content](https://www.ruby-forum.com/t/git-branch-with-same-content/163024)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 7\
**Last updated:** [March 17, 2009, 4:27am UTC](https://www.ruby-forum.com/t/git-branch-with-same-content/163024 "2009-03-17T04:27:36Z")

</div>

I’m rather new to Git and trying to learn it. I did a new branch. I switched over to the new branch by checkout. I added some files and some code, directly in Textmate. But when I switched back to my master branch the…

---

## [ActionMailer max recipients or characters?](https://www.ruby-forum.com/t/actionmailer-max-recipients-or-characters/163066)

<div class="topic-metadata">

**Author:** [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Replies:** 0\
**Last updated:** [March 17, 2009, 3:57am UTC](https://www.ruby-forum.com/t/actionmailer-max-recipients-or-characters/163066 "2009-03-17T03:57:11Z")

</div>

Does anyone know if there is a maximum number of recipients or characters for an ActionMailer message? I’m trying to use ar\_mailer to send out an eNewsletter to hundreds of recipients, but it doesn’t work when the rec…

---

## [Render layout not working for application.xml.builder](https://www.ruby-forum.com/t/render-layout-not-working-for-application-xml-builder/161927)

<div class="topic-metadata">

**Author:** [@zlu](https://www.ruby-forum.com/u/zlu)\
**Replies:** 2\
**Last updated:** [March 17, 2009, 2:10am UTC](https://www.ruby-forum.com/t/render-layout-not-working-for-application-xml-builder/161927 "2009-03-17T02:10:06Z")

</div>

I have layouts/application.xml.builder which is rendered for all xml reponses. In controllers I have: format.xml { render :layout =\> true, :xml =\> @some\_var } This works perfectly fine in rails 2.1.2 and stopped work…

---

## [Error: No migration with version number 2](https://www.ruby-forum.com/t/error-no-migration-with-version-number-2/147153)

<div class="topic-metadata">

**Author:** [@mmascarenhas](https://www.ruby-forum.com/u/mmascarenhas)\
**Replies:** 3\
**Last updated:** [March 17, 2009, 1:38am UTC](https://www.ruby-forum.com/t/error-no-migration-with-version-number-2/147153 "2009-03-17T01:38:11Z")

</div>

Is this error familiar to anyone?? Any suggestions?? C:\\test\>rake db:migrate (in C:/test) rake aborted! No migration with version number 2 (See full trace by running task with --trace) C:\\test\>rake db:migrate --tra…

---

## [Trouble consuming REST from OpenStreetMap - self-closing elements, perhaps?](https://www.ruby-forum.com/t/trouble-consuming-rest-from-openstreetmap-self-closing-elements-perhaps/162876)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [March 17, 2009, 1:27am UTC](https://www.ruby-forum.com/t/trouble-consuming-rest-from-openstreetmap-self-closing-elements-perhaps/162876 "2009-03-17T01:27:26Z")

</div>

I’m consuming openstreetmap.org’s REST api: API v0.5 - OpenStreetMap Wiki and I get an error when I try to run the following code in my ActiveResource model: GET /api/0.5/map?bbox=left,bottom,right,top def self.feat…

---

## [Upgrading to Rails with git v2.3.2 tag](https://www.ruby-forum.com/t/upgrading-to-rails-with-git-v2-3-2-tag/163055)

<div class="topic-metadata">

**Author:** [@dukael](https://www.ruby-forum.com/u/dukael)\
**Replies:** 0\
**Last updated:** [March 17, 2009, 1:05am UTC](https://www.ruby-forum.com/t/upgrading-to-rails-with-git-v2-3-2-tag/163055 "2009-03-17T01:05:46Z")

</div>

Hi, This bit me but I haven’t seen it mentioned on here yet. I have Rails vendored as a submodule so to upgrade from the release candidate to 2.3 I simply pulled and checked out the v2.3.2 tag (73fc42cc0b5e9454148003…

---

## [Problem with Socket.getaddrinfo inside controller or model](https://www.ruby-forum.com/t/problem-with-socket-getaddrinfo-inside-controller-or-model/160430)

<div class="topic-metadata">

**Author:** [@iwakura](https://www.ruby-forum.com/u/iwakura)\
**Replies:** 1\
**Last updated:** [March 17, 2009, 12:17am UTC](https://www.ruby-forum.com/t/problem-with-socket-getaddrinfo-inside-controller-or-model/160430 "2009-03-17T00:17:47Z")

</div>

I am using Rails 2.2.2, trying to get hostname by IP with code like require ‘socket’ Socket.getaddrinfo(‘221.186.184.68’, nil, “AF\_INET”) In the rails console it works well and gives me: \[\[“AF\_INET”, 0, “carbon.ruby…

---

## [Access an attribute in the find method](https://www.ruby-forum.com/t/access-an-attribute-in-the-find-method/163042)

<div class="topic-metadata">

**Author:** [@loader](https://www.ruby-forum.com/u/loader)\
**Replies:** 3\
**Last updated:** [March 17, 2009, 12:15am UTC](https://www.ruby-forum.com/t/access-an-attribute-in-the-find-method/163042 "2009-03-17T00:15:26Z")

</div>

Hello everyone :slight\_smile: I need to access an attribute directly into a find. Is that possible? For instance: Topics.find(:all, :conditions =\> expiration\_date-1.hour + " \< NOW( )") Here, expiration\_date would be …

---

## [Version of Struct for initializing via Hash](https://www.ruby-forum.com/t/version-of-struct-for-initializing-via-hash/163037)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 0\
**Last updated:** [March 16, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/version-of-struct-for-initializing-via-hash/163037 "2009-03-16T21:57:14Z")

</div>

is there any equivalent to this class A attr\_accessor :foo, :bar def initialize(options={}) options.each{|k,v| send("#{k}=", v)} end end I know that OpenStruct is very similar, but you don’t get to define specifi…

---

## [RAND() for MySQL, RANDOM() for SQLite](https://www.ruby-forum.com/t/rand-for-mysql-random-for-sqlite/163031)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 4\
**Last updated:** [March 16, 2009, 9:54pm UTC](https://www.ruby-forum.com/t/rand-for-mysql-random-for-sqlite/163031 "2009-03-16T21:54:37Z")

</div>

I’m trying to pick some random rows from my database; for development I use SQLite and for production I use MySQL. However, as the title suggests, they both have different ways to get random rows. How can I abstract t…

---

## [Observers and outside methods](https://www.ruby-forum.com/t/observers-and-outside-methods/162810)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 3\
**Last updated:** [March 16, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/observers-and-outside-methods/162810 "2009-03-16T21:31:35Z")

</div>

I’m thinking about using observers for my situation. Basically whenever an object is created, I want a message to be sent to a user via a PM system I made. At the moment this is happening within the create method of t…

---

## [Countries primary\_key](https://www.ruby-forum.com/t/countries-primary-key/163030)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 0\
**Last updated:** [March 16, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/countries-primary-key/163030 "2009-03-16T21:05:07Z")

</div>

I’m using: ActiveRecord::Base.primary\_key\_prefix\_type = :table\_name\_with\_underscore per a design spec that I cannot change. I wanted to create a countries table, here is my migration: class CreateCountries \< ActiveRe…

---

## [Rails 2.3.2 won't start with "can't modify frozen class/module"](https://www.ruby-forum.com/t/rails-2-3-2-wont-start-with-cant-modify-frozen-class-module/163028)

<div class="topic-metadata">

**Author:** [@fjan](https://www.ruby-forum.com/u/fjan)\
**Replies:** 0\
**Last updated:** [March 16, 2009, 8:49pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-wont-start-with-cant-modify-frozen-class-module/163028 "2009-03-16T20:49:16Z")

</div>

Hi all. Rails 2.3.2 won’t start for me. It says “can’t modify frozen class/ module”, on this statement in my environment.rb: config.action\_view.erb\_trim\_mode = “-%”. Anybody have any ideas? Did I hit a bug?

---

## [Auto update model](https://www.ruby-forum.com/t/auto-update-model/163023)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 1\
**Last updated:** [March 16, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/auto-update-model/163023 "2009-03-16T19:25:08Z")

</div>

I have a model: user (id, username, password, … key), where “key” is sha1 hach of username + password. How can I update key every time when user update own information?

---

## [Basic program but getting confused](https://www.ruby-forum.com/t/basic-program-but-getting-confused/162919)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 4\
**Last updated:** [March 16, 2009, 7:22pm UTC](https://www.ruby-forum.com/t/basic-program-but-getting-confused/162919 "2009-03-16T19:22:25Z")

</div>

I’m trying to create a pretty basic program, I think. But I’m getting confused with all the tutorials that go to far in detail for what I’m looking for. I’ve been working with Ruby for only a couple days so my knowle…

---

## [Why does default scope break the #new method?](https://www.ruby-forum.com/t/why-does-default-scope-break-the-new-method/163014)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 5\
**Last updated:** [March 16, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/why-does-default-scope-break-the-new-method/163014 "2009-03-16T19:09:53Z")

</div>

class Event \< ActiveRecord::Base default\_scope :conditions =\> “id = 1” end Event.new undefined method \`1=’ for #Event:0xb68ce02c

---

## [Routers and dot in string parameter](https://www.ruby-forum.com/t/routers-and-dot-in-string-parameter/163019)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 1\
**Last updated:** [March 16, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/routers-and-dot-in-string-parameter/163019 "2009-03-16T19:09:17Z")

</div>

map.page ‘:sex/:word’, :controller =\> ‘say’, :requirements =\> { : sex =\>/girl|boy/ } So this works fine: http://mypage.com/say/boy/hello also this: http://mypage.com/say/girl/hello%20world but this: http://mypage.…

---

## [Searchable Rails API Doc](https://www.ruby-forum.com/t/searchable-rails-api-doc/163008)

<div class="topic-metadata">

**Author:** [@voloko](https://www.ruby-forum.com/u/voloko)\
**Replies:** 6\
**Last updated:** [March 16, 2009, 6:46pm UTC](https://www.ruby-forum.com/t/searchable-rails-api-doc/163008 "2009-03-16T18:46:22Z")

</div>

I’ve been using rails and rails’ doc for quite a while now. And I always missed the search feature in docs. IMHO browser search in page is not the best solution. So i’ve spent this weekend trying to improve things a b…

---

## [Alternatives to mixins](https://www.ruby-forum.com/t/alternatives-to-mixins/161945)

<div class="topic-metadata">

**Author:** [@arjackson](https://www.ruby-forum.com/u/arjackson)\
**Replies:** 8\
**Last updated:** [March 16, 2009, 6:07pm UTC](https://www.ruby-forum.com/t/alternatives-to-mixins/161945 "2009-03-16T18:07:26Z")

</div>

Hi all, I was reading James’ summary of engines in rails 2.3 ( http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/) and at the bottom there is “While the code mixing mechanism is quite neat, there are oth…

---

## [BAI file parser](https://www.ruby-forum.com/t/bai-file-parser/163011)

<div class="topic-metadata">

**Author:** [@jackson](https://www.ruby-forum.com/u/jackson)\
**Replies:** 0\
**Last updated:** [March 16, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/bai-file-parser/163011 "2009-03-16T16:40:00Z")

</div>

Howdy, Does anyone know of a library to parse BAI files? Or a conversion tool that I can access via a web interface? Googling hasn’t brought up much in this realm. Thanks a lot! Jackson

---

## [Starling Service](https://www.ruby-forum.com/t/starling-service/162783)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [March 16, 2009, 4:15pm UTC](https://www.ruby-forum.com/t/starling-service/162783 "2009-03-16T16:15:18Z")

</div>

Does anyone know a graceful way to stop the Starling service? I can’t seem to find any documentation and have just been issuing a kill command on the pid. Thanks, Tom

---

## [Bug in plug-in open\_id\_authentication](https://www.ruby-forum.com/t/bug-in-plug-in-open-id-authentication/161423)

<div class="topic-metadata">

**Author:** [@vikrant](https://www.ruby-forum.com/u/vikrant)\
**Replies:** 1\
**Last updated:** [March 16, 2009, 3:04pm UTC](https://www.ruby-forum.com/t/bug-in-plug-in-open-id-authentication/161423 "2009-03-16T15:04:47Z")

</div>

Hi, There is a little bug in open\_id\_authentication plug-in at line 87 of file lib/open\_id\_authentication.rb identifier = “http://#{identifier}” unless identifier =~ /^http/i this line will silently ignore the uri “h…

---

## [Very basic question - writing instance method](https://www.ruby-forum.com/t/very-basic-question-writing-instance-method/162894)

<div class="topic-metadata">

**Author:** [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Replies:** 4\
**Last updated:** [March 16, 2009, 3:01pm UTC](https://www.ruby-forum.com/t/very-basic-question-writing-instance-method/162894 "2009-03-16T15:01:14Z")

</div>

If we are calling an instance method on particular instance of an object as: @obj1.perform\_sanity\_check(@obj2) Will the instance method perform\_sanity\_check have access to @obj1 attributes? How do I / Do I need to …

---

## [Rss maker make issue - Please help](https://www.ruby-forum.com/t/rss-maker-make-issue-please-help/163003)

<div class="topic-metadata">

**Author:** [@asplake](https://www.ruby-forum.com/u/asplake)\
**Replies:** 0\
**Last updated:** [March 16, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/rss-maker-make-issue-please-help/163003 "2009-03-16T14:57:36Z")

</div>

I am a RoR newbie. I have a problem with getting the rss content when using rss:maker.make (using rails 2.2.2 and Ruby 1.8). I am trying to get the full XML definition to be written to a file. When I try it locally it…

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

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