Skip to content

Commit 3ed8b59

Browse files
rjocolemandblock
authored andcommitted
Add Rails-API integration instructions to the README.
1 parent 871958b commit 3ed8b59

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,31 @@ end
104104

105105
To update Swagger UI from its [distribution](https://github.com/wordnik/swagger-ui), run `bundle exec rake swagger_ui:dist:update`. Examine the changes carefully.
106106

107+
### Enabling in a Rails-API Project
108+
109+
The grape-swagger-rails gem uses the Rails asset pipeline for its Javascript and CSS. Enable the asset pipeline with [rails-api](https://github.com/rails-api/rails-api).
110+
111+
Add sprockets to `config/application.rb`.
112+
113+
```ruby
114+
require 'sprockets/railtie'
115+
```
116+
117+
Include JavaScript in `app/assets/javascripts/application.js`.
118+
119+
```javascript
120+
//
121+
//= require_tree .
122+
```
123+
124+
Include CSS stylesheets in `app/assets/stylesheets/application.css`.
125+
126+
```css
127+
/*
128+
*= require_tree .
129+
*/
130+
```
131+
107132
## Contributors
108133

109134
* [unloved](https://github.com/unloved)

0 commit comments

Comments
 (0)