ruby-on-rails-2

How to upgrade Rails app from 2.3.5 to 3.2.x?

…衆ロ難τιáo~ 提交于 2019-12-06 05:43:45
问题 I have Rails 2.3.5 app, I want to upgrade to 3.2.x. How do I upgrade to Rails 3.2.x? Thanks 回答1: I definitely recommend installing the Rails upgrade gem (rails upgrade gem). It's proven for me to be incredibly useful as a starting point for listing and verifying all the required upgrades to get to Rails 3.0. I would also recommend this ebook http://www.railsupgradehandbook.com/ Once you're at Rails 3.0, you'll need to migrate to the asset pipeline, this is another good starting point: http:/

Rails 2.3 and rspec-rails compatability

故事扮演 提交于 2019-12-06 02:58:02
问题 What version of the rspec-rails gem is still compatible with Rails 2.3 branch (2.3.14 specifically)? I've tried 2.1.0 , but that one's also for Rails >= 3.0. Any other dependencies or version limitations that I should be aware of? Thanks. 回答1: Version 1.3.4 is the latest supported version for Rails 2.x. http://rubygems.org/gems/rspec-rails/versions/1.3.4 来源: https://stackoverflow.com/questions/9274329/rails-2-3-and-rspec-rails-compatability

Rails legacy app and Ruby 2 error: can not load translations from the file type yml is not known

对着背影说爱祢 提交于 2019-12-05 10:55:59
I have a legacy Rails application which I want to upgrade to recent Rails and Ruby versions.To start with I am trying to setup the application with Ruby 2.1.2 $ rails -v Rails 2.3.18 $ ruby -v ruby 2.1.2p95 (2014-05-08 revision 45877) [i686-linux] When I tried to run the rake task rake db:schema:load RAILS_ENV=test I encountered following error can not load translations from /activesupport-2.3.18/lib/active_support/locale/en.yml, the file type yml is not known Searching through Google I found the following reference https://github.com/rails/rails/issues/10514 which mentioned that there is

application wide global variable

我只是一个虾纸丫 提交于 2019-12-05 01:04:19
In Rails , where should I define the variable which can be recognized by every layer of Rails stacks. For example, I would like to have a CUSTOMER_NAME='John' variable which can be accessed in helper , rake task, controller and model . Where should I define this variable in Rails app? I am using Rails v2.3.2 In an initializer in /app/config/initializers all .rb files in here get loaded, I usually create one called preferences.rb for things like this. See: http://guides.rubyonrails.org/configuring.html#using-initializer-files An alternative approach is to set a key on the config object in

How to upgrade Rails app from 2.3.5 to 3.2.x?

给你一囗甜甜゛ 提交于 2019-12-04 12:50:59
I have Rails 2.3.5 app, I want to upgrade to 3.2.x. How do I upgrade to Rails 3.2.x? Thanks juliehache I definitely recommend installing the Rails upgrade gem ( rails upgrade gem ). It's proven for me to be incredibly useful as a starting point for listing and verifying all the required upgrades to get to Rails 3.0. I would also recommend this ebook http://www.railsupgradehandbook.com/ Once you're at Rails 3.0, you'll need to migrate to the asset pipeline, this is another good starting point: http://railscasts.com/episodes/282-upgrading-to-rails-3-1 This won't be a simple task and you'll need

Rails 2.3 and rspec-rails compatability

ぐ巨炮叔叔 提交于 2019-12-04 07:28:31
What version of the rspec-rails gem is still compatible with Rails 2.3 branch (2.3.14 specifically)? I've tried 2.1.0 , but that one's also for Rails >= 3.0. Any other dependencies or version limitations that I should be aware of? Thanks. Version 1.3.4 is the latest supported version for Rails 2.x. http://rubygems.org/gems/rspec-rails/versions/1.3.4 来源: https://stackoverflow.com/questions/9274329/rails-2-3-and-rspec-rails-compatability

Implementing auto complete for more than one field in Rails

邮差的信 提交于 2019-12-04 06:18:22
问题 I have an app, which implements a group feature. Each group has n members. Also, each group has a group specific profile pic to it. I have been able to implement auto complete for the group feature keeping in mind the group name alone. I have referred to the following tutorial for the same:- http://railsforum.com/viewtopic.php?id=23188 I am using ruby 1.8.7 and rails 2.0.2 for project specific purpose. I have installed the auto_complete plugin in the appropriate directory. I am on Ubuntu 10

Throw an exception whenever someone tries to mass-assign protected attributes

浪尽此生 提交于 2019-12-04 03:47:15
I'm fixing some mass assignment vulnerabilities in a client's application and I want to make sure Rails isn't silently dropping attempts to mass assign protected attributes. Instead, I want to throw an exception so I can investigate. I.e., whenever this would normally appear in the logs: WARNING: Can't mass-assign these protected attributes: ... I'd like to throw an exception instead (or in addition) Edit: I'm using Rails 2.3.4 You'll have to do some Rails monkey-patching to do this. Be sure to only use this code in development and/or test though since you don't want your app raising errors if

`add_frozen_gem_path': undefined method `source_index' for Gem:Module (NoMethodError) OR Gem.source_index is deprecated

社会主义新天地 提交于 2019-12-03 18:23:28
I am using rails 2.3.11, ruby-1.9.2-p320. Trying to run script/server but getting this error :- system@admin:~/apps/app_name/trunk$ script/server => Booting WEBrick => Rails 2.3.11 application starting on http://0.0.0.0:3000 /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path': undefined method `source_index' for Gem:Module (NoMethodError) from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/initializer.rb:298:in `add_gem_load_paths' from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems

Implementing auto complete for more than one field in Rails

二次信任 提交于 2019-12-02 07:58:47
I have an app, which implements a group feature. Each group has n members. Also, each group has a group specific profile pic to it. I have been able to implement auto complete for the group feature keeping in mind the group name alone. I have referred to the following tutorial for the same:- http://railsforum.com/viewtopic.php?id=23188 I am using ruby 1.8.7 and rails 2.0.2 for project specific purpose. I have installed the auto_complete plugin in the appropriate directory. I am on Ubuntu 10.04 OS I would like to integrate two more things as part of the current auto complete feature for groups