Skip to content

Commit

Permalink
Add doc for ApiTaster.route_path (c3ee730)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtomaszewski committed Sep 25, 2013
1 parent 08d137d commit 91fe608
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rails.application.routes.draw do
end
```

In `routes.rb`, define parameters for each API endpoint after the normal routes definition block. For example:
In `lib/api_tasters/routes.rb`, define parameters for each API endpoint after the normal routes definition block. For example:

```ruby
if Rails.env.development?
Expand Down Expand Up @@ -60,6 +60,11 @@ if Rails.env.development?
end
```

You can change the default `lib/api_tasters/routes.rb` path by creating `config/initializers/api_taster.rb` with the content below:
```ruby
ApiTaster.route_path = Rails.root.to_s + "/app/api_tasters" # just an example
```

### Share Params with Test Factories

If you use a test factory such as [FactoryGirl](https://github.com/thoughtbot/factory_girl), you can require your test factories and share the params. For example in FactoryGirl you can use the `attributes_for(:name_of_factory)` method.
Expand Down

0 comments on commit 91fe608

Please sign in to comment.