# Rails

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

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

---

## [How can I return a json packet?](https://www.ruby-forum.com/t/how-can-i-return-a-json-packet/113033)

<div class="topic-metadata">

**Author:** [@hashman](https://www.ruby-forum.com/u/hashman)\
**Replies:** 0\
**Last updated:** [August 26, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-json-packet/113033 "2007-08-26T15:43:49Z")

</div>

I used extjs and ror,this is the part of my ror code: def create @enterprise = Enterprise.new(@params\[:enterprise\]) p @enterprise if @enterprise.save flash\[:note\] = ‘Enterprise unit was successfully created.’ p “mi…

---

## [URL is gone](https://www.ruby-forum.com/t/url-is-gone/113034)

<div class="topic-metadata">

**Author:** [@pedz](https://www.ruby-forum.com/u/pedz)\
**Replies:** 1\
**Last updated:** [August 26, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/url-is-gone/113034 "2007-08-26T15:34:31Z")

</div>

In routes, I have: … map.resources :item\_types … In my template I have the standard: \<td\>\<%= link\_to 'Show', item\_base %\>\</td\> But I get this error: ActionView::TemplateError (undefined method \`item\_base\_path’ for …

---

## [Listing values belonging to logged-in user](https://www.ruby-forum.com/t/listing-values-belonging-to-logged-in-user/112991)

<div class="topic-metadata">

**Author:** [@jandot](https://www.ruby-forum.com/u/jandot)\
**Replies:** 2\
**Last updated:** [August 26, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/listing-values-belonging-to-logged-in-user/112991 "2007-08-26T14:07:52Z")

</div>

I saw a post on creating user Management Using Salted Hash Login Generator. I followed the steps, but I cannot get it to work. I keep getting a nil the troublesome code is in the plunge\_controller.rb: def list @plun…

---

## [Displaying inline image from params](https://www.ruby-forum.com/t/displaying-inline-image-from-params/113015)

<div class="topic-metadata">

**Author:** [@Jack\_W\_Jennings](https://www.ruby-forum.com/u/Jack_W_Jennings)\
**Replies:** 1\
**Last updated:** [August 26, 2007, 12:49pm UTC](https://www.ruby-forum.com/t/displaying-inline-image-from-params/113015 "2007-08-26T12:49:25Z")

</div>

I’d like to display an image from the data submitted from a file field before it’s written to the database, but I’m having a hard time figuring it out. If I put the send\_data function into crop, the image displays, bu…

---

## [Mysql string](https://www.ruby-forum.com/t/mysql-string/113027)

<div class="topic-metadata">

**Author:** [@harper](https://www.ruby-forum.com/u/harper)\
**Replies:** 0\
**Last updated:** [August 26, 2007, 12:09pm UTC](https://www.ruby-forum.com/t/mysql-string/113027 "2007-08-26T12:09:46Z")

</div>

hi, hope u’r all having a good week ahead - does anyone know how to modify / change existing text in a db? with the code @foods = Food.find(:all) food\_rows = @foods.collect(&:fruit) food\_rows.each |r| r.gsub(“reall…

---

## [Mysql help](https://www.ruby-forum.com/t/mysql-help/113024)

<div class="topic-metadata">

**Author:** [@harper](https://www.ruby-forum.com/u/harper)\
**Replies:** 1\
**Last updated:** [August 26, 2007, 12:08pm UTC](https://www.ruby-forum.com/t/mysql-help/113024 "2007-08-26T12:08:39Z")

</div>

does anyone know how to modify / change existing text in a db (replace func.) ? something like - ========DB======== table foods column fruit row 1 “we really need to bring apples and fruit” row 2 “we really need…

---

## [Belongs\_to question](https://www.ruby-forum.com/t/belongs-to-question/113021)

<div class="topic-metadata">

**Author:** [@Davo](https://www.ruby-forum.com/u/Davo)\
**Replies:** 1\
**Last updated:** [August 26, 2007, 11:23am UTC](https://www.ruby-forum.com/t/belongs-to-question/113021 "2007-08-26T11:23:11Z")

</div>

Hi everyone, I’m wondering what is the correct way to access a column from a belongs\_to table. The code below works is OK for the product.category.name line but fails for the product.make.name line. Yet they are bot…

---

## [How do I assign default values to model attribute](https://www.ruby-forum.com/t/how-do-i-assign-default-values-to-model-attribute/112990)

<div class="topic-metadata">

**Author:** [@cujigar](https://www.ruby-forum.com/u/cujigar)\
**Replies:** 5\
**Last updated:** [August 26, 2007, 11:23am UTC](https://www.ruby-forum.com/t/how-do-i-assign-default-values-to-model-attribute/112990 "2007-08-26T11:23:07Z")

</div>

I have a model with a attribute named “code”. Every time i create an instance I want the “code” to be initialized by making a call to “generate\_code” method. How do i initialize model attributes in rails ?? thanks for…

---

## [\[ select\_tag and options\_for\_select \] posting problem](https://www.ruby-forum.com/t/select-tag-and-options-for-select-posting-problem/113008)

<div class="topic-metadata">

**Author:** [@argyre](https://www.ruby-forum.com/u/argyre)\
**Replies:** 1\
**Last updated:** [August 26, 2007, 2:17am UTC](https://www.ruby-forum.com/t/select-tag-and-options-for-select-posting-problem/113008 "2007-08-26T02:17:26Z")

</div>

Hello community! Here is the problem: I’m using select\_tag and options\_for\_select for the 50 U.S States to be sent to the database table called “properties”. But upon a new posting or editing a posting, it does not p…

---

## [Actionmailer + attachment\_fu](https://www.ruby-forum.com/t/actionmailer-attachment-fu/113007)

<div class="topic-metadata">

**Author:** [@patternhunter](https://www.ruby-forum.com/u/patternhunter)\
**Replies:** 1\
**Last updated:** [August 26, 2007, 1:56am UTC](https://www.ruby-forum.com/t/actionmailer-attachment-fu/113007 "2007-08-26T01:56:39Z")

</div>

image model class Image \< ActiveRecord::Base has\_attachment end mailman controller class Mailman \< ActionMailer::Base def receive(email) email.attachments.each do |attachment| Image.create :uploaded\_data =\> a…

---

## [Including status in response](https://www.ruby-forum.com/t/including-status-in-response/113005)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 0\
**Last updated:** [August 26, 2007, 12:45am UTC](https://www.ruby-forum.com/t/including-status-in-response/113005 "2007-08-26T00:45:36Z")

</div>

I want my response to include either the json or xml text, but I also want it to include the http status 201. How can I do this? if @manufacturer.save format.xml { render :xml =\> @manufacturer.to\_xml } format.json …

---

## [Color gem](https://www.ruby-forum.com/t/color-gem/112978)

<div class="topic-metadata">

**Author:** [@mariko](https://www.ruby-forum.com/u/mariko)\
**Replies:** 2\
**Last updated:** [August 26, 2007, 12:09am UTC](https://www.ruby-forum.com/t/color-gem/112978 "2007-08-26T00:09:57Z")

</div>

I’m using the ruby gem “Color” and I’m having some troubles with to\_hex. I’ve installed the gem, and when I try and run the test program I get this error: red = Color.new(‘ff0000’) =\> #\<Color:0x3685990 @saturation=…

---

## [How to get an activeresource object attributes?](https://www.ruby-forum.com/t/how-to-get-an-activeresource-object-attributes/112964)

<div class="topic-metadata">

**Author:** [@patcito](https://www.ruby-forum.com/u/patcito)\
**Replies:** 3\
**Last updated:** [August 25, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/how-to-get-an-activeresource-object-attributes/112964 "2007-08-25T23:06:57Z")

</div>

Hey all, I have an activeresource model Profile: class Profile \< ActiveResource::Base self.site=“http://0.0.0.0:3002” end I used to do Profile.new and this returned an object with all the Profile attributes but sin…

---

## [Form with saved and new model instances](https://www.ruby-forum.com/t/form-with-saved-and-new-model-instances/112950)

<div class="topic-metadata">

**Author:** [@jameskelly](https://www.ruby-forum.com/u/jameskelly)\
**Replies:** 1\
**Last updated:** [August 25, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/form-with-saved-and-new-model-instances/112950 "2007-08-25T22:05:13Z")

</div>

Hello all - I’m looking to create a form that would allow the editing of existing model instances while also allowing new model instances to be created. (its an order form where the model instances would be an order l…

---

## [Testing create action with associations](https://www.ruby-forum.com/t/testing-create-action-with-associations/112857)

<div class="topic-metadata">

**Author:** [@Robin\_F](https://www.ruby-forum.com/u/Robin_F)\
**Replies:** 1\
**Last updated:** [August 25, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/testing-create-action-with-associations/112857 "2007-08-25T21:51:14Z")

</div>

Hi, In my objects controller, I call the following in order to create an object: def create @object = @account.objects.build params\[:object\] respond\_to do |format| if @object.save … end The account variable is …

---

## [\[ANN\] view\_test 0.10.0](https://www.ruby-forum.com/t/ann-view-test-0-10-0/113000)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 0\
**Last updated:** [August 25, 2007, 9:38pm UTC](https://www.ruby-forum.com/t/ann-view-test-0-10-0/113000 "2007-08-25T21:38:13Z")

</div>

view\_test is a similar implementation of rspec’s controller and view specs for test/unit. It allows you to migrate existing tests one test at a time to create simpler functional tests by extracting out all of the view…

---

## [Passing Multiple Parameters from observe\_field](https://www.ruby-forum.com/t/passing-multiple-parameters-from-observe-field/112949)

<div class="topic-metadata">

**Author:** [@Philip\_N](https://www.ruby-forum.com/u/Philip_N)\
**Replies:** 2\
**Last updated:** [August 25, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/passing-multiple-parameters-from-observe-field/112949 "2007-08-25T20:43:05Z")

</div>

I need to pass through two parameters to a controller method from an observe\_field : the value of the field and another local variable. I can get it working for either of the two, but not for both. This is what I’m go…

---

## [What are options used for?](https://www.ruby-forum.com/t/what-are-options-used-for/112947)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 3\
**Last updated:** [August 25, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/what-are-options-used-for/112947 "2007-08-25T19:38:59Z")

</div>

Hello, I actually have few simple questions which I cannot find a answer for in the documentation? 1# In most of the methods in rails I find the parameter options={} which I don’t know what it can include? Can someb…

---

## [Help me out of this](https://www.ruby-forum.com/t/help-me-out-of-this/196446)

<div class="topic-metadata">

**Author:** [@cool](https://www.ruby-forum.com/u/cool)\
**Replies:** 2\
**Last updated:** [August 25, 2007, 7:29pm UTC](https://www.ruby-forum.com/t/help-me-out-of-this/196446 "2007-08-25T19:29:59Z")

</div>

Hi, I am new to the platform. I have used manual instaaltion. downloaded ruby latestversion and installed. ruby -v = 1.8.6 downloaded .zip package of ruby gems, extracted and run setup. gem -v = 0.9.4 downloaded all…

---

## [How can I use ext with rails?](https://www.ruby-forum.com/t/how-can-i-use-ext-with-rails/112998)

<div class="topic-metadata">

**Author:** [@hashman](https://www.ruby-forum.com/u/hashman)\
**Replies:** 0\
**Last updated:** [August 25, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/how-can-i-use-ext-with-rails/112998 "2007-08-25T17:12:33Z")

</div>

Sorry to my poor english. I’m just beginning to use Extjs with Rails.There is problem with the form submit. Here is the rhtml code: Here is the js coe: ================ Simple form ======================= …

---

## [Coding Project](https://www.ruby-forum.com/t/coding-project/112992)

<div class="topic-metadata">

**Author:** [@Tanguero](https://www.ruby-forum.com/u/Tanguero)\
**Replies:** 0\
**Last updated:** [August 25, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/coding-project/112992 "2007-08-25T16:48:32Z")

</div>

Hello - I have a project that requires AJAX and I gather that ROR is great for that. Where can I post my project in order to receive bids from qualified coders? Thanks

---

## [Helper in other helper](https://www.ruby-forum.com/t/helper-in-other-helper/112987)

<div class="topic-metadata">

**Author:** [@memex](https://www.ruby-forum.com/u/memex)\
**Replies:** 0\
**Last updated:** [August 25, 2007, 2:34pm UTC](https://www.ruby-forum.com/t/helper-in-other-helper/112987 "2007-08-25T14:34:23Z")

</div>

Hello everyone, in my view, I wrap a form\_for around a model: \<% form\_for(: \[…\] ) do |f| %\> Now I repeat the following very often why I would like to extract it into a helper: \<%= f.text\_field :field\_1, :class=\>“c…

---

## [Choose a pagination solution](https://www.ruby-forum.com/t/choose-a-pagination-solution/112920)

<div class="topic-metadata">

**Author:** [@niconoe](https://www.ruby-forum.com/u/niconoe)\
**Replies:** 4\
**Last updated:** [August 25, 2007, 2:16pm UTC](https://www.ruby-forum.com/t/choose-a-pagination-solution/112920 "2007-08-25T14:16:20Z")

</div>

Hi ! I’m looking for help to choose a pagination solution. As the built-in pagination is not very practical and will be soon deprecated, I was trying to finc something else. My problem is that most solutions (for exa…

---

## [Using my fixtures with my development db](https://www.ruby-forum.com/t/using-my-fixtures-with-my-development-db/112977)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 2\
**Last updated:** [August 25, 2007, 12:45pm UTC](https://www.ruby-forum.com/t/using-my-fixtures-with-my-development-db/112977 "2007-08-25T12:45:58Z")

</div>

How can I use my fixtures to populate my development db?

---

## [Small yaml problem](https://www.ruby-forum.com/t/small-yaml-problem/112975)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 1\
**Last updated:** [August 25, 2007, 6:22am UTC](https://www.ruby-forum.com/t/small-yaml-problem/112975 "2007-08-25T06:22:27Z")

</div>

Rails seems to throw errors with this yaml: one: id: 1 \_3g2: true \_3gp: false mp4: false What’s the deal?

---

## [ActiveMerchant Paypal IPN and RESTful design](https://www.ruby-forum.com/t/activemerchant-paypal-ipn-and-restful-design/112966)

<div class="topic-metadata">

**Author:** [@mooktakim](https://www.ruby-forum.com/u/mooktakim)\
**Replies:** 1\
**Last updated:** [August 25, 2007, 6:08am UTC](https://www.ruby-forum.com/t/activemerchant-paypal-ipn-and-restful-design/112966 "2007-08-25T06:08:27Z")

</div>

Hello, I’m trying to go all REST of my application. But i’ve come to one problem. How do i do payment, using IPN, in a RESTful way? right now i have an Payments controller. With 2 actions. action “new” shows a page …

---

## [Rails does it leak or not?](https://www.ruby-forum.com/t/rails-does-it-leak-or-not/112958)

<div class="topic-metadata">

**Author:** [@msantoli](https://www.ruby-forum.com/u/msantoli)\
**Replies:** 3\
**Last updated:** [August 25, 2007, 5:58am UTC](https://www.ruby-forum.com/t/rails-does-it-leak-or-not/112958 "2007-08-25T05:58:26Z")

</div>

I am having big problems with an application handling big datasets through activerecord. I need to handle about 10000 records and the memory usage of my mongrel process reaches up to 700MB. The memory is not freed wh…

---

## [Making Multiple Database Connections](https://www.ruby-forum.com/t/making-multiple-database-connections/111860)

<div class="topic-metadata">

**Author:** [@matthew](https://www.ruby-forum.com/u/matthew)\
**Replies:** 2\
**Last updated:** [August 25, 2007, 5:25am UTC](https://www.ruby-forum.com/t/making-multiple-database-connections/111860 "2007-08-25T05:25:24Z")

</div>

Hi, I have a multi-tenant web application. Each tenant’s data is separated into their own database. In rails, I have some code to manually change the database connection using ActiveRecord::Base.establish\_connectio…

---

## [Help! Copyright and Licensing Issue with a client](https://www.ruby-forum.com/t/help-copyright-and-licensing-issue-with-a-client/112881)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 8\
**Last updated:** [August 25, 2007, 5:22am UTC](https://www.ruby-forum.com/t/help-copyright-and-licensing-issue-with-a-client/112881 "2007-08-25T05:22:24Z")

</div>

Hello, Here’s my situation, any advice is greatly appreciated. I was hired as a contractor to advise on technical and IT issues for a media company in April. They were searching for a database system that would work …

---

## [Testing cron jobs that run script/runner](https://www.ruby-forum.com/t/testing-cron-jobs-that-run-script-runner/112965)

<div class="topic-metadata">

**Author:** [@helzer](https://www.ruby-forum.com/u/helzer)\
**Replies:** 1\
**Last updated:** [August 25, 2007, 4:03am UTC](https://www.ruby-forum.com/t/testing-cron-jobs-that-run-script-runner/112965 "2007-08-25T04:03:20Z")

</div>

I’ve got some logic that runs periodically and I want to include that in my tests. I guess, the test will need to modify the Time.now(), so that I can trigger events to happen and also run some code, in the same way …

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

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