Skip to content

Commit

Permalink
Merge pull request shanil-puri#2 from shanil-puri/Migrate-Rails4
Browse files Browse the repository at this point in the history
Updated the initializeers and routes file to make app compatible with Ra...
  • Loading branch information
Druotic committed Sep 21, 2014
2 parents 1a187ef + 9b31f9f commit de4c8df
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 8 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
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 'bootstrap-sass', "~> 2.3.2"
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', '~> 4.0.3'
gem 'coffee-rails'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

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'
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require bootstrap
*= require_self
*= require_tree .
*/
Expand Down
18 changes: 17 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,28 @@ 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

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'

# config.assets.compile = true
# config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif*.js, *.css, *.css.erb, *.sass)
initializer 'setup_asset_pipeline', :group => :all do |app|
# We don't want the default of everything that isn't js or css, because it pulls too many things in
app.config.assets.precompile.shift

# Explicitly register the extensions we are interested in compiling
app.config.assets.precompile.push(Proc.new do |path|
File.extname(path).in? [
'.html', '.erb', '.haml', # Templates
'.png', '.gif', '.jpg', '.jpeg', # Images
'.eot', '.otf', '.svc', '.woff', '.ttf', # Fonts
]
end)
end
end
end
5 changes: 3 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de4c8df

Please sign in to comment.