# Rails

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

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

---

## [Any One Has Noticed The New Javascript (sproutcore) Framework Based On Ruby?](https://www.ruby-forum.com/t/any-one-has-noticed-the-new-javascript-sproutcore-framework-based-on-ruby/140688)

<div class="topic-metadata">

**Author:** [@chenillen](https://www.ruby-forum.com/u/chenillen)\
**Replies:** 1\
**Last updated:** [June 17, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/any-one-has-noticed-the-new-javascript-sproutcore-framework-based-on-ruby/140688 "2008-06-17T17:49:27Z")

</div>

I just saw the Apple’s WWDC, found this frame work very interesting, and cool. I wonder if we can both use Rails & sproutcore. Thanks,

---

## [Sessions change with IE](https://www.ruby-forum.com/t/sessions-change-with-ie/106411)

<div class="topic-metadata">

**Author:** [@helzer](https://www.ruby-forum.com/u/helzer)\
**Replies:** 4\
**Last updated:** [June 17, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/sessions-change-with-ie/106411 "2008-06-17T17:46:21Z")

</div>

My (still under development) website: http://passport\_photo\_validator.onthegosystems.com causes Explorer to change sessions every call. No matter what I click on any page, a new session is generated. When I look at th…

---

## [Has many... more](https://www.ruby-forum.com/t/has-many-more/140659)

<div class="topic-metadata">

**Author:** [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Replies:** 2\
**Last updated:** [June 17, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/has-many-more/140659 "2008-06-17T17:16:56Z")

</div>

Hello there, a Person has\_many projects, and a Project has\_many tasks. Thus, a Person also has many tasks. Is there a way to write this has\_many in the Person class without using :finder\_sql? Thanks a bunch in adva…

---

## [Quick question on updating attributes on the join model in a has\_many :through relationship](https://www.ruby-forum.com/t/quick-question-on-updating-attributes-on-the-join-model-in-a-has-many-through-relationship/140584)

<div class="topic-metadata">

**Author:** [@Morgan\_G](https://www.ruby-forum.com/u/Morgan_G)\
**Replies:** 4\
**Last updated:** [June 17, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/quick-question-on-updating-attributes-on-the-join-model-in-a-has-many-through-relationship/140584 "2008-06-17T17:10:31Z")

</div>

The question is this: how are you supposed to do it? I’ve seen a lot of blog posts that say that HM:T has beaten HABTM and that we can now all easily have data on the join model and go on to show how to enter that d…

---

## [Conditional image resizing (file\_column)](https://www.ruby-forum.com/t/conditional-image-resizing-file-column/140687)

<div class="topic-metadata">

**Author:** [@alfredogz](https://www.ruby-forum.com/u/alfredogz)\
**Replies:** 1\
**Last updated:** [June 17, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/conditional-image-resizing-file-column/140687 "2008-06-17T16:58:37Z")

</div>

Hi IÂ´m using file\_column plugin. I have a model (banner) with a field image. I need to resize this field in diferent sizes depending on the value of other field of the same model (level). Normally I donÂ´t have thi…

---

## [Form w/ two submit buttons](https://www.ruby-forum.com/t/form-w-two-submit-buttons/140644)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 6\
**Last updated:** [June 17, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/form-w-two-submit-buttons/140644 "2008-06-17T15:35:54Z")

</div>

I want to have a form with a save and a cancel button. According to several Web site I should be able to put these two tags shown below in my form: I expect to be able to determine which button is clicked by testin…

---

## [Scaffold fuction not working properly](https://www.ruby-forum.com/t/scaffold-fuction-not-working-properly/123881)

<div class="topic-metadata">

**Author:** [@supasta](https://www.ruby-forum.com/u/supasta)\
**Replies:** 10\
**Last updated:** [June 17, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/scaffold-fuction-not-working-properly/123881 "2008-06-17T15:26:33Z")

</div>

Hey guys, i have just set up a database and ruby on rails application. I then did a ruby script\\generate Product Admin which should give it all of the nessasary parts to run as a web app. Instead it did this: C:\\ruby…

---

## [\[ANN\] Lockdown 0.5.8](https://www.ruby-forum.com/t/ann-lockdown-0-5-8/140689)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 0\
**Last updated:** [June 17, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/ann-lockdown-0-5-8/140689 "2008-06-17T15:22:13Z")

</div>

Lockdown is a authentication/authorization system for RubyOnRails (ver 2.x). This release: Fixes the security for link\_to to allow for external links. Migration name change in template generator for accuracy. Wiki: h…

---

## [Routes](https://www.ruby-forum.com/t/routes/140562)

<div class="topic-metadata">

**Author:** [@Niranjan](https://www.ruby-forum.com/u/Niranjan)\
**Replies:** 1\
**Last updated:** [June 17, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/routes/140562 "2008-06-17T15:07:00Z")

</div>

in routes.rb, we can route based on the path. For example, if the path was http://abcd/xyz, we can route based on ‘xyz’ but can we route based on ‘abcd’??

---

## [Order from db](https://www.ruby-forum.com/t/order-from-db/140669)

<div class="topic-metadata">

**Author:** [@mikael](https://www.ruby-forum.com/u/mikael)\
**Replies:** 3\
**Last updated:** [June 17, 2008, 2:17pm UTC](https://www.ruby-forum.com/t/order-from-db/140669 "2008-06-17T14:17:52Z")

</div>

When i get data from my db i use :order =\> “articles.title” but then i get them like Adam Bono Cecar anna How can i get the data like Adam anna Bono Cecar not get them case-sensitive.

---

## [Testing custom model functions in unit tests](https://www.ruby-forum.com/t/testing-custom-model-functions-in-unit-tests/140611)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 6\
**Last updated:** [June 17, 2008, 1:22pm UTC](https://www.ruby-forum.com/t/testing-custom-model-functions-in-unit-tests/140611 "2008-06-17T13:22:28Z")

</div>

I have a custom function, for kicks: def find\_newest Card.find(:last) end In my unit test I want to: assert\_kind\_of(Card,Card.find\_newest) But I get the “method not found” error. What am I missing? -Tom

---

## [Taking advantage of scm for deployment](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530)

<div class="topic-metadata">

**Author:** [@chovy](https://www.ruby-forum.com/u/chovy)\
**Replies:** 9\
**Last updated:** [June 17, 2008, 12:59pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530 "2008-06-17T12:59:37Z")

</div>

Using :export takes quite a long time, even for editing one file. Is there a way to only push the difference, and not the entire trunk? – Anthony E. 408-656-2473 http://anthony.ettinger.name

---

## [Should rake task be spawned?](https://www.ruby-forum.com/t/should-rake-task-be-spawned/140674)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 0\
**Last updated:** [June 17, 2008, 12:02pm UTC](https://www.ruby-forum.com/t/should-rake-task-be-spawned/140674 "2008-06-17T12:02:56Z")

</div>

Hi I have rake code as below…What I am doing is sending mail to sd\_records=ServiceDeskTicket.find :all, :conditions=\>\[“updated\_on \< ? and service\_desk\_status\_id != ?”,48.hours.ago,6\] for record in sd\_records puts “S…

---

## [RSpec HTTP get simulation](https://www.ruby-forum.com/t/rspec-http-get-simulation/140534)

<div class="topic-metadata">

**Author:** [@reis](https://www.ruby-forum.com/u/reis)\
**Replies:** 2\
**Last updated:** [June 17, 2008, 11:59am UTC](https://www.ruby-forum.com/t/rspec-http-get-simulation/140534 "2008-06-17T11:59:47Z")

</div>

Gi guis, I’m using the RSpec testing plugin to make my tests, but I’ve encountered a problem. In my application I’ve different named routes that go to the same controller, so to simulate a session HTTP request I can’t…

---

## [To calculate differnece between two time variables](https://www.ruby-forum.com/t/to-calculate-differnece-between-two-time-variables/140663)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 6\
**Last updated:** [June 17, 2008, 11:30am UTC](https://www.ruby-forum.com/t/to-calculate-differnece-between-two-time-variables/140663 "2008-06-17T11:30:56Z")

</div>

Hi In the table I have a field updated\_on (type :datetime)…I have to calculate the differnce in hours between that and current time…How can I do that? I tried like for example time1=TimeTable.find(1).updated\_on …

---

## [Rails 2.1 and mysql's mediumint](https://www.ruby-forum.com/t/rails-2-1-and-mysqls-mediumint/140311)

<div class="topic-metadata">

**Author:** [@rasmus](https://www.ruby-forum.com/u/rasmus)\
**Replies:** 6\
**Last updated:** [June 17, 2008, 9:40am UTC](https://www.ruby-forum.com/t/rails-2-1-and-mysqls-mediumint/140311 "2008-06-17T09:40:04Z")

</div>

Hi there, Browsing the activerecord-2.1.0 source code I found the following: case limit when 0..3 "smallint(#{limit})" when 4..8 "int(#{limit})" when 9..20 "bigint(#{limit})" else …

---

## [Validating elements created via JS](https://www.ruby-forum.com/t/validating-elements-created-via-js/140647)

<div class="topic-metadata">

**Author:** [@galeal](https://www.ruby-forum.com/u/galeal)\
**Replies:** 3\
**Last updated:** [June 17, 2008, 9:28am UTC](https://www.ruby-forum.com/t/validating-elements-created-via-js/140647 "2008-06-17T09:28:16Z")

</div>

I have a link on a form that allows for infinite new records to be created. i.e. Clicking “Add new record” basically renders the \_new partial and appends it to a div. The model contains validates\_uniqueness\_of and va…

---

## [Validate called twice - normal?](https://www.ruby-forum.com/t/validate-called-twice-normal/140646)

<div class="topic-metadata">

**Author:** [@ngeadah](https://www.ruby-forum.com/u/ngeadah)\
**Replies:** 4\
**Last updated:** [June 17, 2008, 9:12am UTC](https://www.ruby-forum.com/t/validate-called-twice-normal/140646 "2008-06-17T09:12:21Z")

</div>

I’m playing around with ActiveScaffold and noticed my validations are being called twice. I’m really not sure if this is a Rails problem or something caused by ActiveScaffold, but is it normal that all the validation…

---

## [Help With id](https://www.ruby-forum.com/t/help-with-id/140661)

<div class="topic-metadata">

**Author:** [@link](https://www.ruby-forum.com/u/link)\
**Replies:** 1\
**Last updated:** [June 17, 2008, 9:07am UTC](https://www.ruby-forum.com/t/help-with-id/140661 "2008-06-17T09:07:01Z")

</div>

Hello. I have my rb file: class CreateDepartamentos \< ActiveRecord::Migration def self.up create\_table :departamentos, :id=\>null do |t| t.string :cvedept, :limit=\>10, :null=\>false t.string :desdept, :limit=\>20, :nul…

---

## [ERROR: Failed to build gem native extension](https://www.ruby-forum.com/t/error-failed-to-build-gem-native-extension/140561)

<div class="topic-metadata">

**Author:** [@ramesh](https://www.ruby-forum.com/u/ramesh)\
**Replies:** 1\
**Last updated:** [June 17, 2008, 9:02am UTC](https://www.ruby-forum.com/t/error-failed-to-build-gem-native-extension/140561 "2008-06-17T09:02:18Z")

</div>

Hi, I’m trtying to install postgress v0.7.9.2008.01.28 gems: C:\>gem install -v=0.7.9.2008.01.28 postgres Building native extensions. This could take a while… ERROR: While executing gem … (Gem::Installer::ExtensionB…

---

## [How to set tabindex in date\_select](https://www.ruby-forum.com/t/how-to-set-tabindex-in-date-select/140655)

<div class="topic-metadata">

**Author:** [@ChandleWEi](https://www.ruby-forum.com/u/ChandleWEi)\
**Replies:** 0\
**Last updated:** [June 17, 2008, 7:58am UTC](https://www.ruby-forum.com/t/how-to-set-tabindex-in-date-select/140655 "2008-06-17T07:58:43Z")

</div>

\<%= date\_select(‘user’, ‘birthdate’, { :start\_year =\> 80.years.ago.year, :end\_year =\> 12.years.ago.year } ) %\> work in rails 1.2.2 date\_select(object\_name, method, options = {}) I try many times but also didn’t …

---

## [RMagick help](https://www.ruby-forum.com/t/rmagick-help/140517)

<div class="topic-metadata">

**Author:** [@ron](https://www.ruby-forum.com/u/ron)\
**Replies:** 17\
**Last updated:** [June 17, 2008, 7:38am UTC](https://www.ruby-forum.com/t/rmagick-help/140517 "2008-06-17T07:38:43Z")

</div>

Hi, So now that I’m not making ridiculous typos, I’ve got my homegrown photo uploading system going. But now the question is, how do I implement ImageMagick photo features? I’ve got ImageMagick and the RMagick gem …

---

## [How to use form\_for with rjs](https://www.ruby-forum.com/t/how-to-use-form-for-with-rjs/140479)

<div class="topic-metadata">

**Author:** [@athem](https://www.ruby-forum.com/u/athem)\
**Replies:** 3\
**Last updated:** [June 17, 2008, 5:59am UTC](https://www.ruby-forum.com/t/how-to-use-form-for-with-rjs/140479 "2008-06-17T05:59:46Z")

</div>

Hello, How can I use a form variable in a partial rendered from within a page.replace\_html rjs call? Here’s the problem: I’m trying to render a partial with form fields using rjs. In the erb template: \<% form\_for :…

---

## [Newbie question about rails on apache2](https://www.ruby-forum.com/t/newbie-question-about-rails-on-apache2/196704)

<div class="topic-metadata">

**Author:** [@Allan\_Du](https://www.ruby-forum.com/u/Allan_Du)\
**Replies:** 4\
**Last updated:** [June 17, 2008, 3:18am UTC](https://www.ruby-forum.com/t/newbie-question-about-rails-on-apache2/196704 "2008-06-17T03:18:15Z")

</div>

Hi, I just setup my rails application on apache2, just a very simply controller, and one method /stats/show When go to the root page, I can see the rails default page, but if I go to any other page like stats/show le…

---

## [How to set default month or day in f.date\_select field](https://www.ruby-forum.com/t/how-to-set-default-month-or-day-in-f-date-select-field/139485)

<div class="topic-metadata">

**Author:** [@shikha](https://www.ruby-forum.com/u/shikha)\
**Replies:** 5\
**Last updated:** [June 17, 2008, 3:08am UTC](https://www.ruby-forum.com/t/how-to-set-default-month-or-day-in-f-date-select-field/139485 "2008-06-17T03:08:15Z")

</div>

hi all, i have got a problem in my project. i have f.date\_select field in my form and i want to set the default date = current date+30. but f.date\_select is not allowing me to do so. there are options to set year onl…

---

## [Active Record Insert relationship](https://www.ruby-forum.com/t/active-record-insert-relationship/140470)

<div class="topic-metadata">

**Author:** [@rodusa](https://www.ruby-forum.com/u/rodusa)\
**Replies:** 5\
**Last updated:** [June 17, 2008, 12:05am UTC](https://www.ruby-forum.com/t/active-record-insert-relationship/140470 "2008-06-17T00:05:04Z")

</div>

I need help inserting an address record to a tabled called realestates. The relationship between these to tables is 1 to 1. realestates table has an address\_id field set to not NULL class Address \< ActiveRecord::Base …

---

## [Is there a built in variable for the current path?](https://www.ruby-forum.com/t/is-there-a-built-in-variable-for-the-current-path/140622)

<div class="topic-metadata">

**Author:** [@sw0rdfish](https://www.ruby-forum.com/u/sw0rdfish)\
**Replies:** 3\
**Last updated:** [June 16, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/is-there-a-built-in-variable-for-the-current-path/140622 "2008-06-16T23:56:31Z")

</div>

Probably a silly question, but I’m trying to create a partial that I use in two seperate resources… one is called Tickets and one is TicketsSearch. I have links at the top of the page that order my seatrch by passing …

---

## [Validating Virtual Properties](https://www.ruby-forum.com/t/validating-virtual-properties/140621)

<div class="topic-metadata">

**Author:** [@Trogdor](https://www.ruby-forum.com/u/Trogdor)\
**Replies:** 5\
**Last updated:** [June 16, 2008, 10:50pm UTC](https://www.ruby-forum.com/t/validating-virtual-properties/140621 "2008-06-16T22:50:02Z")

</div>

Hello, I have two virtual properties (schedule and diameter) that are saved in the db as one property (diameter\_schedule\_id -\> fk to another model). When you set the properties in the model, they locate the proper Di…

---

## [Git : changes to my local repository but not pushed upstream](https://www.ruby-forum.com/t/git-changes-to-my-local-repository-but-not-pushed-upstream/140629)

<div class="topic-metadata">

**Author:** [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Replies:** 0\
**Last updated:** [June 16, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/git-changes-to-my-local-repository-but-not-pushed-upstream/140629 "2008-06-16T22:48:42Z")

</div>

This is a git question. I have a private github repository for an application. After a couple of hours of work and a few commits I want to know what all commits have not been pushed to the github server. When I execu…

---

## [Recurring Events feature set](https://www.ruby-forum.com/t/recurring-events-feature-set/140471)

<div class="topic-metadata">

**Author:** [@Alan\_Wong](https://www.ruby-forum.com/u/Alan_Wong)\
**Replies:** 8\
**Last updated:** [June 16, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/recurring-events-feature-set/140471 "2008-06-16T22:27:33Z")

</div>

Hi all, I’m a J2EE developer by day and I’m moonlighting to migrate my church’s website to a Rails application. One of the fundamental abstractions that any organization needs to track is events. Events could be work…

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

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