# Rails

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

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

---

## [Searching a Related model with a scope](https://www.ruby-forum.com/t/searching-a-related-model-with-a-scope/143035)

<div class="topic-metadata">

**Author:** [@itsbs](https://www.ruby-forum.com/u/itsbs)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/searching-a-related-model-with-a-scope/143035 "2008-07-14T17:57:50Z")

</div>

Hi, everybody! I am trying to figure out how to add a related model to an anonymous scope to complete a search. Right now, I have this: if request.post? scope = Record.scoped({}) scope = scope.conditions “color = ?…

---

## [About string error for upload file in rails 2.1](https://www.ruby-forum.com/t/about-string-error-for-upload-file-in-rails-2-1/143031)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/about-string-error-for-upload-file-in-rails-2-1/143031 "2008-07-14T17:55:53Z")

</div>

hello: I have code for upload image file to server file system.This works in rails 1.2.3.But in rails 2.1,it gets an error. The following is the important code: In a view: \<%form\_for :user,:url=\>{:action=\>“register…

---

## [A String.from\_java\_bytes Equivalent?](https://www.ruby-forum.com/t/a-string-from-java-bytes-equivalent/142816)

<div class="topic-metadata">

**Author:** [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/a-string-from-java-bytes-equivalent/142816 "2008-07-14T17:55:42Z")

</div>

I am looking at the following blog posting where someone is using jruby and iText to create a pdf file and then sending it to the browser : http://codersifu.blogspot.com/2007/06/howto-generate-pdf-files-in-ruby-on.html …

---

## [Upload File Corruption Error](https://www.ruby-forum.com/t/upload-file-corruption-error/143029)

<div class="topic-metadata">

**Author:** [@Marra](https://www.ruby-forum.com/u/Marra)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/upload-file-corruption-error/143029 "2008-07-14T17:51:24Z")

</div>

Hello All, I’ve been reading a lot of blogs/tutorials on how to go about uploading files to a server via a form in my application - they all pointed me in the direction that “File.open(self.path, “wb”) { |f| f.write(@…

---

## [How updating the views when changing the DB?](https://www.ruby-forum.com/t/how-updating-the-views-when-changing-the-db/143018)

<div class="topic-metadata">

**Author:** [@monsterag](https://www.ruby-forum.com/u/monsterag)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/how-updating-the-views-when-changing-the-db/143018 "2008-07-14T17:49:05Z")

</div>

Hello, i am new to Ruby. question: i used scaffold to create a Database migration with lets say 2 fields: name:string surname:string The scaffolding and migrationprocess has done the DB and the view edit delete act…

---

## [Easy way to add .html extension to all URLs?](https://www.ruby-forum.com/t/easy-way-to-add-html-extension-to-all-urls/142987)

<div class="topic-metadata">

**Author:** [@etetet](https://www.ruby-forum.com/u/etetet)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/easy-way-to-add-html-extension-to-all-urls/142987 "2008-07-14T17:49:04Z")

</div>

Is there an easy way to add a .html extension to the end of all URLs? I’ve tried adding this to routes.rb: map.connect ‘:controller/:action/:id.html’, :format =\> ‘html’ or this to the ApplicationController: def defau…

---

## [RailsConf 2008 Europe - room sharing](https://www.ruby-forum.com/t/railsconf-2008-europe-room-sharing/143005)

<div class="topic-metadata">

**Author:** [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/railsconf-2008-europe-room-sharing/143005 "2008-07-14T17:48:36Z")

</div>

Hi everyone, I’ve just registered for the two conference days, the response-mail from O’reilly linked to a “room-sharing” wiki. But the wiki is empty. Is there anywhere else, that people are organising room sharing? …

---

## [AR Models in Module](https://www.ruby-forum.com/t/ar-models-in-module/142846)

<div class="topic-metadata">

**Author:** [@mrpunkin](https://www.ruby-forum.com/u/mrpunkin)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 5:14pm UTC](https://www.ruby-forum.com/t/ar-models-in-module/142846 "2008-07-14T17:14:25Z")

</div>

Hello all, I have a module, illustrated below, with a few classes. I have required environment.rb and can access my models just fine outside the module, and even within the module’s root, but once I try and access one…

---

## [Count the Split up Tag values](https://www.ruby-forum.com/t/count-the-split-up-tag-values/141903)

<div class="topic-metadata">

**Author:** [@Marra](https://www.ruby-forum.com/u/Marra)\
**Replies:** 6\
**Last updated:** [July 14, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/count-the-split-up-tag-values/141903 "2008-07-14T16:57:39Z")

</div>

Hello! I have in my database the tags for a specific entry separated by commas and I’m using a SQL statement that pulls all the tags for a bunch of entries and the ruby code on the page: \<%- for notes in @tags\_sql do…

---

## [Returning to anchor point after form submit](https://www.ruby-forum.com/t/returning-to-anchor-point-after-form-submit/143026)

<div class="topic-metadata">

**Author:** [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 4:50pm UTC](https://www.ruby-forum.com/t/returning-to-anchor-point-after-form-submit/143026 "2008-07-14T16:50:02Z")

</div>

Does anyone know how to do the following? I’m not even sure if it is possible without Ajax… I have a form for a contact’s details. The form also contains fields for 1 or more associated telephones. The form has a “rea…

---

## [Ruby on rails and .jar files](https://www.ruby-forum.com/t/ruby-on-rails-and-jar-files/139097)

<div class="topic-metadata">

**Author:** [@SurviveStyle5](https://www.ruby-forum.com/u/SurviveStyle5)\
**Replies:** 5\
**Last updated:** [July 14, 2008, 4:41pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-and-jar-files/139097 "2008-07-14T16:41:51Z")

</div>

Hi, I’m pretty new to Ruby on Rails and web development in general. I have a question and was wondering if anyone could help me out. Right now I have some .jar files that are embedded in a web page ala… \<Applet …

---

## [Ruby on Rails Opportunities](https://www.ruby-forum.com/t/ruby-on-rails-opportunities/143023)

<div class="topic-metadata">

**Author:** [@laura](https://www.ruby-forum.com/u/laura)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-opportunities/143023 "2008-07-14T16:23:04Z")

</div>

I have 4 opportunities for Ruby on rails developers working in a mid size company which are full time opportunities. I would love to dusciss this opportunity with anyone that is interested or has a referral. I do offe…

---

## [Aggregating multiple ActiveRecord relationships](https://www.ruby-forum.com/t/aggregating-multiple-activerecord-relationships/143022)

<div class="topic-metadata">

**Author:** [@jack](https://www.ruby-forum.com/u/jack)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/aggregating-multiple-activerecord-relationships/143022 "2008-07-14T16:23:04Z")

</div>

The following pastie will help with my question below: help: http://pastie.org/219582 A user has\_many Items via both the User model as well as the user’s parent Account model . Other users are able to make their own I…

---

## [How to use Rails framework in stand alone ruby file ? (+)](https://www.ruby-forum.com/t/how-to-use-rails-framework-in-stand-alone-ruby-file/142999)

<div class="topic-metadata">

**Author:** [@falko](https://www.ruby-forum.com/u/falko)\
**Replies:** 5\
**Last updated:** [July 14, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/how-to-use-rails-framework-in-stand-alone-ruby-file/142999 "2008-07-14T16:21:54Z")

</div>

Good day. I want to run rb-script via Cron, for inseringt data in database. Is it possible using ActiveRecord, for accessing to DBMS. What should I reguire in rb-file ?

---

## ["upcasing!" model attributes](https://www.ruby-forum.com/t/upcasing-model-attributes/142818)

<div class="topic-metadata">

**Author:** [@pepe](https://www.ruby-forum.com/u/pepe)\
**Replies:** 13\
**Last updated:** [July 14, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/upcasing-model-attributes/142818 "2008-07-14T16:21:18Z")

</div>

Hi. A couple of days ago I posted a question about how to simplify the task of converting string values to uppercase when saving a row and with some help I got to the point of writing the following in a before\_save m…

---

## [Parse haml for gettext: RubyLex Error](https://www.ruby-forum.com/t/parse-haml-for-gettext-rubylex-error/143017)

<div class="topic-metadata">

**Author:** [@benni](https://www.ruby-forum.com/u/benni)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/parse-haml-for-gettext-rubylex-error/143017 "2008-07-14T15:35:25Z")

</div>

hey I would like to bring the newest versions of haml(2.0.1), rails(2.1.0) and gettext(1.91.0) in my current project together. But in the moment, I failure on parsing the haml-files to update my po-files. This is the …

---

## [How to assert a simple link (testing)](https://www.ruby-forum.com/t/how-to-assert-a-simple-link-testing/143002)

<div class="topic-metadata">

**Author:** [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Replies:** 3\
**Last updated:** [July 14, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/how-to-assert-a-simple-link-testing/143002 "2008-07-14T15:08:41Z")

</div>

\<%= link\_to ‘my\_profile’,:controller =\> ‘users’, :action =\> ‘show’, :id =\> current\_user.id %\> my\_profile What is the easy and simple way to assert this link in testing.

---

## [How to install plugin from \*.tar.gz or \*.zip?](https://www.ruby-forum.com/t/how-to-install-plugin-from-tar-gz-or-zip/142870)

<div class="topic-metadata">

**Author:** [@makoto\_kuwata](https://www.ruby-forum.com/u/makoto_kuwata)\
**Replies:** 6\
**Last updated:** [July 14, 2008, 2:26pm UTC](https://www.ruby-forum.com/t/how-to-install-plugin-from-tar-gz-or-zip/142870 "2008-07-14T14:26:20Z")

</div>

Hi, I have a question about Rails plugin distribution. Is it possible to install plugin from .tar.gz. or .zip file? For example: ruby script/plugin install http://example.com/public/foobar.tar.gz Is it possible? I…

---

## [Where to define callbacks? Model vs model\_oberver](https://www.ruby-forum.com/t/where-to-define-callbacks-model-vs-model-oberver/142912)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 5\
**Last updated:** [July 14, 2008, 1:44pm UTC](https://www.ruby-forum.com/t/where-to-define-callbacks-model-vs-model-oberver/142912 "2008-07-14T13:44:20Z")

</div>

Hi guys, I am wondering where I should define my callbacks. I have a user model and a few callbacks: before\_save, after\_save, etc. I can define each callback in the model, but it is getting a bit messy and overcrowde…

---

## [AJAX updates for execution progress status](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479)

<div class="topic-metadata">

**Author:** [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Replies:** 6\
**Last updated:** [July 14, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479 "2008-07-14T13:21:00Z")

</div>

I need to update multiple areas on my page within the same controller, where statuses are updated as test scripts are being run and completed. My js first renders a list of the available test cases to run, then I have…

---

## [Form causing error =\> "Only post requests are allowed"?](https://www.ruby-forum.com/t/form-causing-error-only-post-requests-are-allowed/142964)

<div class="topic-metadata">

**Author:** [@scottnj](https://www.ruby-forum.com/u/scottnj)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 11:10am UTC](https://www.ruby-forum.com/t/form-causing-error-only-post-requests-are-allowed/142964 "2008-07-14T11:10:10Z")

</div>

Why does the form give the error “Only post requests are allowed.” when submitted to my action? I know the form is supposed to be a post. the rake routes looks ok. some reason there is a “\_method”=\>“put” in the reques…

---

## [Writing multiple checkbox values](https://www.ruby-forum.com/t/writing-multiple-checkbox-values/142973)

<div class="topic-metadata">

**Author:** [@jasonwold](https://www.ruby-forum.com/u/jasonwold)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 11:02am UTC](https://www.ruby-forum.com/t/writing-multiple-checkbox-values/142973 "2008-07-14T11:02:23Z")

</div>

Is it possible to write multiple checkbox values? When i click on submit, the first value “accounting\_services” is written to the database, but all of the others are ignored. I created a column in my registration data…

---

## [How to use Rails in stand alone rb-file](https://www.ruby-forum.com/t/how-to-use-rails-in-stand-alone-rb-file/142995)

<div class="topic-metadata">

**Author:** [@falko](https://www.ruby-forum.com/u/falko)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 10:56am UTC](https://www.ruby-forum.com/t/how-to-use-rails-in-stand-alone-rb-file/142995 "2008-07-14T10:56:42Z")

</div>

Good Day. I want to run some rb-file via Cron, for inserting data in database. Is it possible to use Model from my project, in stand alone rb-file? What should i require in rb-File?

---

## [It might be ORM problem](https://www.ruby-forum.com/t/it-might-be-orm-problem/197177)

<div class="topic-metadata">

**Author:** [@sadeesh\_kumar](https://www.ruby-forum.com/u/sadeesh_kumar)\
**Replies:** 12\
**Last updated:** [July 14, 2008, 10:47am UTC](https://www.ruby-forum.com/t/it-might-be-orm-problem/197177 "2008-07-14T10:47:05Z")

</div>

Hi, I have a model user.rb, a controller userdata\_controller, methods in the controller and respective .rhtml files. I created a registration page. Saved into users table and it works fine. But sometimes its throwing…

---

## [Receiving mail from not strictly RFC-valid email addresses](https://www.ruby-forum.com/t/receiving-mail-from-not-strictly-rfc-valid-email-addresses/142994)

<div class="topic-metadata">

**Author:** [@macdigger](https://www.ruby-forum.com/u/macdigger)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 10:36am UTC](https://www.ruby-forum.com/t/receiving-mail-from-not-strictly-rfc-valid-email-addresses/142994 "2008-07-14T10:36:52Z")

</div>

Hello, I have a blog system which allows users to post articles to their blogs from mobile phones. Users just set up their mobile phone address in blog settings and then send messages from mobile phone to designated …

---

## [How to make HABTM bulk-assignment transactional?](https://www.ruby-forum.com/t/how-to-make-habtm-bulk-assignment-transactional/142986)

<div class="topic-metadata">

**Author:** [@nbits](https://www.ruby-forum.com/u/nbits)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 9:07am UTC](https://www.ruby-forum.com/t/how-to-make-habtm-bulk-assignment-transactional/142986 "2008-07-14T09:07:38Z")

</div>

I have a model with a has\_and\_belongs\_to\_many relationship that I’d like to bulk-assign a bunch of IDs to, as well as other attributes. Is there any way I can do this in a transaction without having to explicitly dema…

---

## [Observe\_field and select\_tag](https://www.ruby-forum.com/t/observe-field-and-select-tag/142981)

<div class="topic-metadata">

**Author:** [@shenry](https://www.ruby-forum.com/u/shenry)\
**Replies:** 3\
**Last updated:** [July 14, 2008, 8:45am UTC](https://www.ruby-forum.com/t/observe-field-and-select-tag/142981 "2008-07-14T08:45:24Z")

</div>

I have this select field: Access \<%= f.select :access, \[‘Global’, ‘Carrier’, ‘Winery’\], :prompt =\> “Choose One” %\> being observed by: \<%= observe\_field :user\_access, :on =\> ‘blur’, :url =\> {:action =\> :find\_access…

---

## [Rails application failed to start properly](https://www.ruby-forum.com/t/rails-application-failed-to-start-properly/142936)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 8:42am UTC](https://www.ruby-forum.com/t/rails-application-failed-to-start-properly/142936 "2008-07-14T08:42:13Z")

</div>

I think I’m too close to this problem - and I’m guessing that the answer is actually obvious, but I don’t see it. I have an application that’s getting the error message “Rails application failed to start properly”. Ev…

---

## [Render\_as\_string behaviour](https://www.ruby-forum.com/t/render-as-string-behaviour/142982)

<div class="topic-metadata">

**Author:** [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 7:43am UTC](https://www.ruby-forum.com/t/render-as-string-behaviour/142982 "2008-07-14T07:43:13Z")

</div>

Hello guys, I tried to use rtex to generate pdfs, and it worked fine. Then I tried to use render\_as\_string to I could have the pdf data and put it somewhere (specific) in my hard drive, but for some unknown reason (a…

---

## [Question about method "hidden\_div\_if" in AWDR 2](https://www.ruby-forum.com/t/question-about-method-hidden-div-if-in-awdr-2/142978)

<div class="topic-metadata">

**Author:** [@flychunjae](https://www.ruby-forum.com/u/flychunjae)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 6:05am UTC](https://www.ruby-forum.com/t/question-about-method-hidden-div-if-in-awdr-2/142978 "2008-07-14T06:05:53Z")

</div>

I followed the sample code in AWDR 2 like this: store\_helper.rb def hidden\_div\_if(conditions, attributes = {}) if conditions attributes\[“style”\] = “display:none” else attr = tag\_options(attributes.stringify\_keys) …

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

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