Skip to content

Commit 2a9a009

Browse files
committed
update readme
1 parent 3fdc337 commit 2a9a009

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,20 @@ This how-to guide aims to help you get started the right way using Rails 5 to bu
2323

2424
First, make sure you are running Ruby 2.2.2+ or newer as it’s required by Rails 5.
2525

26-
According to the official [Rails guide](//edgeguides.rubyonrails.org/api_app.html) all we need to do to create an API only Rails app is to pass the `--api` option at the command line when creating a new Rails app, like so:
27-
```
28-
rails new api_app_name --api
29-
```
30-
However, as Rails 5 hasn’t been officially released yet things aren’t quite that simple, and we need to generate our Rails API app using the latest version on Github. Simply clone the master branch from the Rails repo:
31-
```
32-
git clone git@github.com:rails/rails.git
33-
```
3426
Now we generate new Rails API application by passing the `--api` directive to the `rails new` command:
3527
```
36-
bundle exec railties/exe/rails new <parent-folder-path>/api_app_name --api --edge
28+
rails __5.0.2__ api_app_name --api
3729
```
38-
The next thing is to run `bundle` and `rake` inside our app directory to install the default gems and setup the database:
30+
The next thing is to run `bundle` inside our app directory to install the default gems and setup the database:
3931
```
40-
cd <parent-folder-path>/api_app_name
32+
cd api_app_name
4133
bundle install
42-
bin/rake db:setup
34+
```
35+
36+
and edit `config/database.yml`:
37+
then run:
38+
```
39+
rails db:create
4340
```
4441

4542
Nice! Now we have a shiny new API only Rails app without any of the incumbent front end bloat, and all of the inherent Railsy goodness.

0 commit comments

Comments
 (0)