From b830e683b0b1f4fdf70afdbe614ee2c33d63c2d8 Mon Sep 17 00:00:00 2001 From: Shanil Puri Date: Sat, 20 Sep 2014 19:43:52 -0400 Subject: [PATCH] Updated the initializeers and routes file to make app compatible with Rails 4. Updated Rails version to 4.1.6 and added corresponding dependencies to Gemfile. --- .gitignore | 5 ++++- Gemfile | 12 +++++++----- config/application.rb | 2 +- config/environments/development.rb | 5 +++-- config/routes.rb | 4 ++-- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 0a85564..ca05a53 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ # Ignore all logfiles and tempfiles. /log/*.log /tmp +# Ignore all Gemgile.lock +Gemfile.lock - +# Ignore the .idea folder generated by RubyMine +.idea/ # Add non-default ignores below diff --git a/Gemfile b/Gemfile index a7a17bd..0022841 100644 --- a/Gemfile +++ b/Gemfile @@ -1,19 +1,21 @@ source 'https://rubygems.org' -gem 'rails', '3.2.13' +gem 'rails', '4.1.6' gem 'execjs' gem 'therubyracer' gem 'bootstrap-sass', '2.0.0' +gem 'activeresource' +gem 'activerecord' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' -gem 'mysql2', '0.3.11' +gem 'mysql2' gem 'devise' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' + gem 'sass-rails', github: 'rails/sass-rails' + gem 'coffee-rails' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms => :ruby @@ -21,7 +23,7 @@ group :assets do gem 'uglifier', '>= 1.0.3' end -gem 'jquery-rails', '1.0.19' +gem 'jquery-rails' # To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' diff --git a/config/application.rb b/config/application.rb index 90caef1..8254520 100644 --- a/config/application.rb +++ b/config/application.rb @@ -57,7 +57,7 @@ class Application < Rails::Application # This will create an empty whitelist of attributes available for mass-assignment for all models # in your app. As such, your models will need to explicitly whitelist or blacklist accessible # parameters by using an attr_accessible or attr_protected declaration. - config.active_record.whitelist_attributes = false + # config.active_record.whitelist_attributes = false # Enable the asset pipeline config.assets.enabled = true diff --git a/config/environments/development.rb b/config/environments/development.rb index 396eba0..cd7a793 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -4,6 +4,7 @@ # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. + config.eager_load = false config.cache_classes = false # Log error messages when you accidentally call methods on nil. @@ -23,11 +24,11 @@ config.action_dispatch.best_standards_support = :builtin # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict + # config.active_record.mass_assignment_sanitizer = :strict # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 + # config.active_record.auto_explain_threshold_in_seconds = 0.5 # Do not compress assets config.assets.compress = false diff --git a/config/routes.rb b/config/routes.rb index 84a895e..542fed1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,8 +10,8 @@ resources :user - match "posts/published", :to => "post#published" - match "posts/drafts", :to => "post#drafts" + get "posts/published", :to => "post#published" + get "posts/drafts", :to => "post#drafts" resources :post do get :show_post_body get :publish_draft