How To Use Rails and Twitter Bootstrap to Start a Simple and Beautiful Blog

Ruby on Rails, often shortened to Rails, is an open source full-stack web application framework for the Ruby programming language.
Twitter Bootstrap is a free collection of tools for creating websites and web applications.
Today I will use Rails and Bootstrap to start a blog web application, just a few lines of command, you can create a simple and beautiful blog web, now let's start.
First, open the Terminal, we have to create a new rails application named blog.
    rails new blog
then we use scaffolding to create a post scafflod and connect to the database.
cd blog
rails generate scaffold Post title:string content:text
rake db:migrate
then we add the bootstrap to the application, open the Gemfile in the blog forder, and add the gem.
group :assets do
    gem 'twitter-bootstrap-rails'
end
then we run the command to install the gem.
bundle install
and it is time to use the bootstrap make the application look beautiful.
rails generate bootstrap:install static
rails g bootstrap:layout application fixed -f
rails g bootstrap:themed Posts -f
at last, you have to open the web server
    rails server
Now, just enjoy you blog application in your web browser through http://localhost:3000/posts


1 comments:

Thank you - super simple instructions.

Reply

Post a Comment