Questions tagged [ruby-on-rails-2]

Legacy version of the Ruby on Rails web development framework.

746 questions
2
votes
1 answer

Migrate an application from 2.3.8 to 3.1

any advice about how to migrate an app from rails 2.3.8 to rails 3.1? Should I go from 2.3.8 to 3.0 and then to 3.1? Let me know your thoughts... I'm especially interested in the approach to the Gemfile... and bundler. Any resource link would be…
2
votes
1 answer

Share session between a Rails2 and Rails3 app

I want to share the session between a Rails 2.3.14 app and a Rails 3.0.10 app by using the session cookie store. I found an excellent blogpost that explains how to set that…
Marco
  • 33
  • 1
  • 6
2
votes
0 answers

How to map a custom rack hander in a rails 2.3 application (dav4rack specifically)?

I am trying to use dav4rack in my rails 2.3.8 application. I am creating a custom config.ru file to load rails, and am using Passenger. The standard rails config.ru file loads just fine: require "config/environment" use Rails::Rack::LogTailer use…
Buffy Miller
  • 71
  • 1
  • 7
2
votes
0 answers

Authlogic secure and httponly cookies patch

I've been trying to apply the gist provided in the issue tracker to add the secure and httponly options and methods on Authlogic cookies, but I'm having some difficulty. I applied the patch and have gotten the new attributes to show up in my…
Josh Kovach
  • 7,679
  • 3
  • 45
  • 62
2
votes
4 answers

top rubyonrails screencast/tutorials/blog url

i am learning rubyonrails and referring http://guides.rubyonrails.org/ for documentations and http://railscasts.com/ for screencast. Are there more such useful sites that could help me to learn more on rubyonrails?
persian
  • 91
  • 1
  • 3
2
votes
3 answers

writing test for rubyonrails

I am new to writing test for rubyonrails app like rspect, steak, cucumber etc. How do I start or learn so that it will help me to write beautiful codes? You can give some simple example or some url where I can understand from zero. Thanks
2
votes
2 answers

404 Custom Error Pages in Rails 2.3

I'm overriding render_optional_error_file to render a custom page whenever there's an error. This works great if there's an error within the application, it renders "shared/error.erb" without problem. My application controller has a few…
peterjwest
  • 4,294
  • 2
  • 33
  • 46
2
votes
1 answer

Is it possible to pass hints to database?

Using rails 2.3.4, is it possible to pass a hint to the database optimizer? I would like to be able to force the use of a particular index for testing purposes. I have (legacy code, yes it smells) : with_exclusive_scope { …
Jeff Paquette
  • 7,089
  • 2
  • 31
  • 40
2
votes
1 answer

rake spec fails where rake spec:(models|controllers|views) pass

I asked this question on the rspec mailing list but didn't get a response, so I thought I'd try here. Using rspec 1.3.2 and rspec-rails 1.3.4 with rails 2.3.11 on ruby 1.9.2-p180, when I $ rake spec:models they all pass. When I $ rake…
Phillip Koebbe
  • 818
  • 5
  • 8
2
votes
1 answer

Avoid ActiveRecord#save logging of large fields

I need to prevent ActiveRecord#save from logging the content of large fields. Is there a way to configure this on Rails 2.3.x? @document.save #=> Will log something like: Apr 20 13:45:42 ubuntu rails[2619]: Document::HTML Update (7.0ms) UPDATE…
Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110
2
votes
2 answers

How do I make a single element JSON array using the Rails XML Builder?

I am using a Rails app as an JSON API service. There is one field that can either hold one or two strings. Below is how I'm creating this JSON element in the .xml.builder file, getting the information from a flattened hash: if…
Erik J
  • 828
  • 9
  • 22
2
votes
1 answer

How to use link_to so that all parameters passed to controller are preserved in Ruby on Rails 2?

I have a bilingual site with nice URLs for SEO. Using Ruby on Rails 2.3.10. routes.rb fragment: map.connect 'order-jira-hosting/:option.html', :controller => 'order', :action => 'index', :locale => 'en' map.connect…
Nowaker
  • 12,154
  • 4
  • 56
  • 62
2
votes
1 answer

Rails form field validation and click handler

I have a form_tag with some mandatory fields as below <% form_tag url do %> <%= text_field_tag "user[name]", user[:name], :required => true %> <%= submit_tag 'Continue', :class => 'submit_button' %> <% end %> When i submit the form with just…
Bhavya
  • 572
  • 3
  • 14
2
votes
1 answer

ActiveRecord::SerializationTypeMismatch: attribute was supposed to be a Hash, but was a String

To get a hash I have this: serialize :colors, Hash But I have an error where it the result of this attribute looks like this: To show this I took out the "Hash" from "serialize :colors, Hash" to see the error in the console. "---…
2
votes
2 answers

classes under lib folder are not detected in rails

In my project, I have written few classes under lib folder but rails is not detecting those classes in production environment. I get the uninitalized Constant error. I use Apache in the production environment and rails script/server in the…