# Rails

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

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

---

## [Yield external file](https://www.ruby-forum.com/t/yield-external-file/125090)

<div class="topic-metadata">

**Author:** [@musty](https://www.ruby-forum.com/u/musty)\
**Replies:** 1\
**Last updated:** [January 11, 2008, 6:22am UTC](https://www.ruby-forum.com/t/yield-external-file/125090 "2008-01-11T06:22:12Z")

</div>

Hello All I currently have a menu on my page which when an option is selected will display the associated rhtml file from one of the views/ directories, nothing fancy works great. I’m trying to extend the menu options…

---

## [Access url\_for from rake task](https://www.ruby-forum.com/t/access-url-for-from-rake-task/123853)

<div class="topic-metadata">

**Author:** [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Replies:** 3\
**Last updated:** [January 11, 2008, 5:42am UTC](https://www.ruby-forum.com/t/access-url-for-from-rake-task/123853 "2008-01-11T05:42:10Z")

</div>

How do I access ActionController:Base url\_for method from a Rake task. I tried to access ActionController from irb but it doesn’t work? Check out the pasite Parked at Loopia – Anil

---

## [Remembering address details and visited page](https://www.ruby-forum.com/t/remembering-address-details-and-visited-page/124376)

<div class="topic-metadata">

**Author:** [@elle](https://www.ruby-forum.com/u/elle)\
**Replies:** 15\
**Last updated:** [January 11, 2008, 5:23am UTC](https://www.ruby-forum.com/t/remembering-address-details-and-visited-page/124376 "2008-01-11T05:23:27Z")

</div>

I actually have 2 questions: Right now when a customer logs in, he gets redirected to the 1st page in the catalog, and the cart session is stored in the database. How can I redirect the customer to his last visited …

---

## [Smarter routing with nested resources](https://www.ruby-forum.com/t/smarter-routing-with-nested-resources/125653)

<div class="topic-metadata">

**Author:** [@giaco](https://www.ruby-forum.com/u/giaco)\
**Replies:** 4\
**Last updated:** [January 11, 2008, 4:36am UTC](https://www.ruby-forum.com/t/smarter-routing-with-nested-resources/125653 "2008-01-11T04:36:40Z")

</div>

I have a number of resources that I want to access in various scopes. The index action would change slightly depending on its scope, but the rest of the actions would be identical aside from needing to preserve the ur…

---

## [Paypal-2.0.0 HELP!](https://www.ruby-forum.com/t/paypal-2-0-0-help/125679)

<div class="topic-metadata">

**Author:** [@spokra](https://www.ruby-forum.com/u/spokra)\
**Replies:** 0\
**Last updated:** [January 11, 2008, 3:57am UTC](https://www.ruby-forum.com/t/paypal-2-0-0-help/125679 "2008-01-11T03:57:31Z")

</div>

ok I installed the gem but it doesn’t work… get get: NameError in PaypalController#index uninitialized constant PaypalController::Paypal RAILS\_ROOT: /home/steven/nwdentaltemps Application Trace | Framework Trace | F…

---

## [Asking for help with a database lookup](https://www.ruby-forum.com/t/asking-for-help-with-a-database-lookup/125215)

<div class="topic-metadata">

**Author:** [@eggman2001](https://www.ruby-forum.com/u/eggman2001)\
**Replies:** 19\
**Last updated:** [January 11, 2008, 3:24am UTC](https://www.ruby-forum.com/t/asking-for-help-with-a-database-lookup/125215 "2008-01-11T03:24:10Z")

</div>

I want to retrieve objects based on two attributes - pay\_period and user. I have no problem with this if an exact pay\_period and user are selected. However, I want “All” to be an option for the two fields and I don’t …

---

## [Need a rails based email client, any out there?](https://www.ruby-forum.com/t/need-a-rails-based-email-client-any-out-there/125675)

<div class="topic-metadata">

**Author:** [@uncle](https://www.ruby-forum.com/u/uncle)\
**Replies:** 0\
**Last updated:** [January 11, 2008, 3:20am UTC](https://www.ruby-forum.com/t/need-a-rails-based-email-client-any-out-there/125675 "2008-01-11T03:20:39Z")

</div>

need a rails based email client, any out there?

---

## [Dynamic selects](https://www.ruby-forum.com/t/dynamic-selects/125673)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 0\
**Last updated:** [January 11, 2008, 2:59am UTC](https://www.ruby-forum.com/t/dynamic-selects/125673 "2008-01-11T02:59:31Z")

</div>

I have been doing some searching and looking on the forum for old topics on the best way to change a select box based on another. So far, I have only been able to get one way to work, and it only works in FireFox (doe…

---

## [How do I get rid of this routing warning?](https://www.ruby-forum.com/t/how-do-i-get-rid-of-this-routing-warning/125671)

<div class="topic-metadata">

**Author:** [@nardman](https://www.ruby-forum.com/u/nardman)\
**Replies:** 0\
**Last updated:** [January 11, 2008, 2:57am UTC](https://www.ruby-forum.com/t/how-do-i-get-rid-of-this-routing-warning/125671 "2008-01-11T02:57:51Z")

</div>

map.category ‘product\_category/:page/path/:path’, :controller =\> ‘product\_category’, :action =\> ‘show’, :requirements =\> {:path =\> /.+/, :page=\>/\\d+/}, :page =\>1 warning is “Route segment “:page” cannot be optional…

---

## [Submit form using a link instead of a button](https://www.ruby-forum.com/t/submit-form-using-a-link-instead-of-a-button/125561)

<div class="topic-metadata">

**Author:** [@fries88](https://www.ruby-forum.com/u/fries88)\
**Replies:** 3\
**Last updated:** [January 11, 2008, 2:42am UTC](https://www.ruby-forum.com/t/submit-form-using-a-link-instead-of-a-button/125561 "2008-01-11T02:42:05Z")

</div>

Hi, Which form should I use? I am currently using form\_for.Is it the right form to use? What I am supposed to do in the form is to save the various fields and go to the next page when i click the link which i am going…

---

## [Constants already initialized warnings](https://www.ruby-forum.com/t/constants-already-initialized-warnings/125608)

<div class="topic-metadata">

**Author:** [@rubynuby](https://www.ruby-forum.com/u/rubynuby)\
**Replies:** 5\
**Last updated:** [January 11, 2008, 1:59am UTC](https://www.ruby-forum.com/t/constants-already-initialized-warnings/125608 "2008-01-11T01:59:25Z")

</div>

I have some constants defined in my application\_helper.rb and I keep getting these warning: already initialzed constant \_\_\_\_\_\_\_\_ I greped my project and made sure these constants are not defined or set elsewhere. is …

---

## [Help with gem freeze](https://www.ruby-forum.com/t/help-with-gem-freeze/125658)

<div class="topic-metadata">

**Author:** [@eggman2001](https://www.ruby-forum.com/u/eggman2001)\
**Replies:** 1\
**Last updated:** [January 11, 2008, 1:10am UTC](https://www.ruby-forum.com/t/help-with-gem-freeze/125658 "2008-01-11T01:10:14Z")

</div>

I’m having trouble with rake rails:freeze:gems on both my windows and linux machines and I was wondering if someone can help. In Windows I’m getting this error. It seems that it can’t rename activesupport due to permi…

---

## [Person\["name"\] and person.name](https://www.ruby-forum.com/t/person-name-and-person-name/125654)

<div class="topic-metadata">

**Author:** [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Replies:** 1\
**Last updated:** [January 11, 2008, 12:57am UTC](https://www.ruby-forum.com/t/person-name-and-person-name/125654 "2008-01-11T00:57:57Z")

</div>

I have object person.=\>#\<person id: 123, name: “test”, sex: “1”\> when I check name value in rails 2.0.2 used: puts person.name I got this Error: #\<NoMethodError: You have a nil object when you didn’t expect it! You…

---

## [Article urls in @articles.to\_xml](https://www.ruby-forum.com/t/article-urls-in-articles-to-xml/115534)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 4\
**Last updated:** [January 11, 2008, 12:43am UTC](https://www.ruby-forum.com/t/article-urls-in-articles-to-xml/115534 "2008-01-11T00:43:59Z")

</div>

I am reading RESTful Web Services, where it is advised as a good practice to connect resources. Is there a way to include article urls in @articles.to\_xml ? – fxn

---

## [Whiser selection of user/roles engines](https://www.ruby-forum.com/t/whiser-selection-of-user-roles-engines/125652)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 1\
**Last updated:** [January 10, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/whiser-selection-of-user-roles-engines/125652 "2008-01-10T23:54:31Z")

</div>

Hi, I just need to offer my application user’s means to login to the system. And be able to assign different roles to those users to protect access to different views of the application. Typical stuff. I’m a bit conf…

---

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

<div class="topic-metadata">

**Author:** [@glenn](https://www.ruby-forum.com/u/glenn)\
**Replies:** 8\
**Last updated:** [January 10, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/routes-question/125515 "2008-01-10T23:45:18Z")

</div>

Hi, I am using Rail 1.2. and tying to create a route like below. map.connect ‘:controller/:action/:object/:id/’, :action =\> :action + '’ + :object, :object =\> /\[a-z|\]+/ For example, if user access main/show/person/1, …

---

## [BUG? has\_many :through makes funny queries](https://www.ruby-forum.com/t/bug-has-many-through-makes-funny-queries/125649)

<div class="topic-metadata">

**Author:** [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Replies:** 0\
**Last updated:** [January 10, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/bug-has-many-through-makes-funny-queries/125649 "2008-01-10T23:05:25Z")

</div>

So I have this structure. class Gallery \< ActiveRecord::Base belongs\_to :owner, :polymorphic =\> true has\_many :folders, :order =\> ‘slug’, :dependent =\> :destroy class Folder \< ActiveRecord::Base has\_many :photos, :d…

---

## [Has\_many questions](https://www.ruby-forum.com/t/has-many-questions/125632)

<div class="topic-metadata">

**Author:** [@jvazquez](https://www.ruby-forum.com/u/jvazquez)\
**Replies:** 1\
**Last updated:** [January 10, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/has-many-questions/125632 "2008-01-10T23:01:34Z")

</div>

I am working on a project where I am uploading data about houses and need pictures to accompany it. I have a model for ‘housing’ and another one for picture. my housing class has\_many :picture and my picture class …

---

## [Help?](https://www.ruby-forum.com/t/help/125638)

<div class="topic-metadata">

**Author:** [@Brooklynboy3](https://www.ruby-forum.com/u/Brooklynboy3)\
**Replies:** 3\
**Last updated:** [January 10, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/help/125638 "2008-01-10T22:54:54Z")

</div>

I suspect this might be a painful question but as one who has never programmed, I am hoping to attempt to teach myself how to do it. A fool’s errand perhaps but one can always hope. I was told by a programming friend …

---

## [How pass the params :id to next action?](https://www.ruby-forum.com/t/how-pass-the-params-id-to-next-action/125635)

<div class="topic-metadata">

**Author:** [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Replies:** 6\
**Last updated:** [January 10, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/how-pass-the-params-id-to-next-action/125635 "2008-01-10T21:57:16Z")

</div>

Hi, everybody: I made a view - works as creating a new comment for a specific article, a example URL is “http://localhost:3000/comments/new/2”: here, comments is the controller, new is the action, 2 is the id of the…

---

## [Gsub With unicode characters](https://www.ruby-forum.com/t/gsub-with-unicode-characters/125641)

<div class="topic-metadata">

**Author:** [@nayru](https://www.ruby-forum.com/u/nayru)\
**Replies:** 0\
**Last updated:** [January 10, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/gsub-with-unicode-characters/125641 "2008-01-10T21:55:48Z")

</div>

Hi I am writing a RoR application that needs to work with a database full of french unicode characters, unfortunately whenever I try to display a field with those values in a show I just get a question mark or no cha…

---

## [How to downgrade Rake](https://www.ruby-forum.com/t/how-to-downgrade-rake/125640)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 0\
**Last updated:** [January 10, 2008, 9:49pm UTC](https://www.ruby-forum.com/t/how-to-downgrade-rake/125640 "2008-01-10T21:49:35Z")

</div>

Hello and thanks in advance I had/have a problem with engines and rake that throws the error: undefined method \`last’ for {}:Hash This is documented here: http://railsforum.com/viewtopic.php?pid=50179 The fix is to …

---

## [Using memcache and file caching at the same time](https://www.ruby-forum.com/t/using-memcache-and-file-caching-at-the-same-time/120266)

<div class="topic-metadata">

**Author:** [@wbharding](https://www.ruby-forum.com/u/wbharding)\
**Replies:** 5\
**Last updated:** [January 10, 2008, 9:08pm UTC](https://www.ruby-forum.com/t/using-memcache-and-file-caching-at-the-same-time/120266 "2008-01-10T21:08:57Z")

</div>

Hi, I want to cache some objects (models) in memcache and some objects (images) in file store. I have successfully configured both independently. Is it possible to use them both at the same time? My setup is Apache l…

---

## [Safari File upload problem](https://www.ruby-forum.com/t/safari-file-upload-problem/73186)

<div class="topic-metadata">

**Author:** [@Anton\_Kuznetsov](https://www.ruby-forum.com/u/Anton_Kuznetsov)\
**Replies:** 1\
**Last updated:** [January 10, 2008, 8:24pm UTC](https://www.ruby-forum.com/t/safari-file-upload-problem/73186 "2008-01-10T20:24:10Z")

</div>

Hello! I found your post to the rubyonrails.org about Safari File upload problem Did you able to solve this issue? \</p\> Is this a known problem? Best regards, Anton M Kuznetsov Tel.:+7 917 34 44533 ICQ:…

---

## [RJS doesn't output correctly](https://www.ruby-forum.com/t/rjs-doesnt-output-correctly/125404)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 11\
**Last updated:** [January 10, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/rjs-doesnt-output-correctly/125404 "2008-01-10T20:20:07Z")

</div>

Hello, I was trying to output a partial with RJS and this is what its returning me as response: try { Element.update(“countView”, “\\074p\\076\\n\\074form method=“POST” action=“search\_date”\\076\\n \\074table align=“cente…

---

## [How can I write this is rails (for loop)](https://www.ruby-forum.com/t/how-can-i-write-this-is-rails-for-loop/125627)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 6\
**Last updated:** [January 10, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/how-can-i-write-this-is-rails-for-loop/125627 "2008-01-10T19:53:16Z")

</div>

I want to write this in rails: @aux= @rep\_tickets.rp\_parts.size for i=0, i\< @aux, i++ @rep.ticket.price=@rep.ticket.price + @rep\_tickets.rp\_part\[i\].price end

---

## [Relative\_url\_root and problems with CSS url()](https://www.ruby-forum.com/t/relative-url-root-and-problems-with-css-url/125537)

<div class="topic-metadata">

**Author:** [@mememe](https://www.ruby-forum.com/u/mememe)\
**Replies:** 1\
**Last updated:** [January 10, 2008, 7:36pm UTC](https://www.ruby-forum.com/t/relative-url-root-and-problems-with-css-url/125537 "2008-01-10T19:36:18Z")

</div>

I’m using relative\_url\_root to allow my app to be run from a sub- domain. Things work fine except with images that are referenced in my CSS code. For example, background-image: url(/images/bg\_image.jpg); does not t…

---

## [Many Static Pages Across Various Domains](https://www.ruby-forum.com/t/many-static-pages-across-various-domains/125497)

<div class="topic-metadata">

**Author:** [@kopf1988](https://www.ruby-forum.com/u/kopf1988)\
**Replies:** 2\
**Last updated:** [January 10, 2008, 7:30pm UTC](https://www.ruby-forum.com/t/many-static-pages-across-various-domains/125497 "2008-01-10T19:30:26Z")

</div>

Alright, what would be the best practice for this?: I have several domains, like www.cmuscatine.com Some have lots of static pages (first two) but others are more dynamic (picture gallery on the third one). I am wor…

---

## [Data base search with advanced options](https://www.ruby-forum.com/t/data-base-search-with-advanced-options/125629)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 0\
**Last updated:** [January 10, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/data-base-search-with-advanced-options/125629 "2008-01-10T19:28:39Z")

</div>

How to approach this problem, i have a search form designed with multiselect list, checkboxes and so on. I need to combine all these things together for a sql query. Let say the SQL from the options in the search form…

---

## [Scaping URL-like strings in links](https://www.ruby-forum.com/t/scaping-url-like-strings-in-links/125626)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 0\
**Last updated:** [January 10, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/scaping-url-like-strings-in-links/125626 "2008-01-10T19:03:27Z")

</div>

Hi you all, I have a model whose one of its attributes has a URL-like string value. I want to do searches by this URL, so I can have a link pointing at: bugs/by/uri/{value}, where value can be:/whatever.net/bla/bla W…

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

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