How to downgrade bundler or upgrade rails?
Try the following commands: gem uninstall bundler gem install bundler –version ‘1.0.0’
Try the following commands: gem uninstall bundler gem install bundler –version ‘1.0.0’
In Rails 4, Associations have an optional scope parameter that accepts a lambda that is applied to the Relation (cf. the doc for ActiveRecord::Associations::ClassMethods) class SolarSystem < ActiveRecord::Base has_many :planets, -> { life_supporting } end class Planet < ActiveRecord::Base scope :life_supporting, -> { where(‘distance_from_sun > ?’, 5).order(‘diameter ASC’) } end In Rails 3, the where_values … Read more
change_column_null worked perfectly: change_column_null :users, :email, true The reverse has a nice option to update existing records (but not set the default) when null is not allowed.
I had the same problem using the Postgres.app from Heroku. Rebooting my Mac solved it.
UPDATED Originally, this answer stated that although this was possible with a few tricks, it was strongly discouraged. This was based on advice on the Heroku developer support website. However, recently Heroku issued a communication specifically describing how to achieve this, and have watered down their advice on the developer site. The complete text of … Read more
Bundler is launched from your app’s root directory so it makes sure all needed gems are present to get your app working.If for some reason you no longer need a gem you’ll have to run the gem uninstall gem_name as you stated above.So every time you run bundler it’ll recheck dependencies EDIT – 24.12.2014 I … Read more
My solution is first(:link, link).click instead of click_link(link)
In the controller where you want to disable CSRF the check: skip_before_action :verify_authenticity_token Or to disable it for everything except a few methods: skip_before_action :verify_authenticity_token, :except => [:update, :create] Or to disable only specified methods: skip_before_action :verify_authenticity_token, :only => [:custom_auth, :update] More info: RoR Request Forgery Protection
This works for me. Find (zombie?) server (can happen when quitting terminal with server running): $ ps ax | grep rails If it returns something like: 33467 s002 S+ 0:00.00 grep rails 33240 s003 S+ 0:15.05 /Users/Arta/.rbenv/versions/1.9.2-p290/bin/ruby script/rails s -p 3000 kill it, and run anew: $ kill -9 33240 $ rails s
I have noticed the following: Full Engine With a full engine, the parent application inherits the routes from the engine. It is not necessary to specify anything in parent_app/config/routes.rb. Specifying the gem in Gemfile is enough for the parent app to inherit the models, routes etc. The engine routes are specified as: # my_engine/config/routes.rb Rails.application.routes.draw … Read more