syedmusamah / grape_on_rails_routes

See Rails-like routes for Grape API's mounted on Rails
MIT License
91 stars 14 forks source link

[Question] - Can I have this functionality integrated in rake routes? #7

Closed pmatsinopoulos closed 8 years ago

pmatsinopoulos commented 8 years ago

Hi,

How can I have this functionality integrated in rake routes?

Thanks in advance

texpert commented 8 years ago

Hi!

This is clearly stated in the https://github.com/syedmusamah/grape_on_rails_routes/blob/master/README.md - just add this gem to your Gemfile and then run the rake task:

rake grape:routes
pmatsinopoulos commented 8 years ago

Hi,

Thanks for quick response!

I was thinking whether, in my Rails project, I could have all the routes, including the ones related to my project using Grape and the ones defined using standard Rails routes, printed out using rake routes and not rake grape:routes. Now, I have to use two commands (rake routes and rake grape:routes). But it may not be possible. Is my question clear?

Thanks in advance. And thank you for that useful gem anyway.

texpert commented 8 years ago

Thanks goes to author of the gem, to @syedmusamah ! :)

As for your question, you could put the task https://github.com/syedmusamah/grape_on_rails_routes/blob/master/lib/tasks/grape.rake in your Rakefile without namespacing it as :grape - and then you could run 'rake routes' and get all the Rails and Grape routes. The gem shouldn't be required in the Gemfile in this case.