Skip to content

Instantly share code, notes, and snippets.

@inossidabile
Last active October 5, 2015 05:48
Show Gist options
  • Save inossidabile/2759363 to your computer and use it in GitHub Desktop.
Save inossidabile/2759363 to your computer and use it in GitHub Desktop.
Joosy / Blog / Rails preparations
@import 'bootstrap';
@import 'font-awesome';
body {
padding-top: 60px;
}
bundle install
rails new joosy-blog
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'sqlite3'
gem 'joosy', '~> 1.1.1' # <- add this
gem 'jquery-rails'
group :assets do
gem 'bootstrap-sass', '~> 2.3.2.0' # <- and this
gem 'font-awesome-sass-rails' # <- and this
gem 'sass-rails', '~> 3.2.6'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '>= 1.0.3'
end
rails g joosy:application blog
rails g joosy:preloader blog
# app/models/post.rb
class Post < ActiveRecord::Base
attr_accessible :body, :title
has_many :comments
end
# app/models/comment.rb
class Comment < ActiveRecord::Base
attr_accessible :body, :post
belongs_to :post, :counter_cache => true
end
rails g scaffold Post title:string body:text comments_count:integer
rails g scaffold Comment post:references body:text
# db/seeds.rb
posts = Post.create([
{ title: 'Welcome there', body: 'Hey, welcome to the joosy blog example' },
{ title: 'Test post', body: 'Nothing there. Really' }
])
Comment.create(body: 'Great article!', post: posts.first)
@denispeplin
Copy link

anjlab-bootstrap-rails 2.0.4.1 is broken: anjlab/bootstrap-rails#24

The fix is:
gem 'anjlab-bootstrap-rails', '2.0.4.4', :require => 'bootstrap-rails'

@btaitelb
Copy link

I ended up using

#Gemfile
group :assets do
  # left the others the same
  gem 'anjlab-bootstrap-rails', :github => 'anjlab/bootstrap-rails', :require => 'bootstrap-rails'
end
#app/assets/application.css.scss
/*
 *= require twitter/boostrap
 *= require_self
 *= require_tree .
*/

@import 'twitter/bootstrap';
@import 'font-awesome';

body {
  padding-top: 60px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment