Last active
October 5, 2015 05:48
-
-
Save inossidabile/2759363 to your computer and use it in GitHub Desktop.
Joosy / Blog / Rails preparations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import 'bootstrap'; | |
@import 'font-awesome'; | |
body { | |
padding-top: 60px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails new joosy-blog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails g joosy:application blog | |
rails g joosy:preloader blog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails g scaffold Post title:string body:text comments_count:integer | |
rails g scaffold Comment post:references body:text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
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
anjlab-bootstrap-rails
2.0.4.1 is broken: anjlab/bootstrap-rails#24The fix is:
gem 'anjlab-bootstrap-rails', '2.0.4.4', :require => 'bootstrap-rails'