How to auto generate Rails REST API documentation for controllers? [closed] - ruby-on-rails

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
How to automatically generate API documentation for Rails REST controller?
Is there any example I can look into using RDoc to do this?

You can try apipie-rails which I created: https://github.com/Pajk/apipie-rails/
It can do more things than just generate documentation, more info on https://github.com/Pajk/apipie-rails/.

I found https://github.com/zipmark/rspec_api_documentation to be a really nice tool. It's driven off of rspec acceptance tests so you're writing documentation at the same time you're writing acceptance tests! Double win!

Use rapi_doc gem. The setup is very simple and straight forward. Follow this tutorial: http://www.rubyglob.com/generating-api-documentation-with-rapi_doc/

You can use "calamum" a ruby build program to generate a nice html api doc from yaml file definition.
https://github.com/malachheb/calamum

Although is not automatic, I define and document my APIs using RESTful API Modeling Language or, RAML.
There are Node.js packages that turn the yaml file into a nice looking html documentation, like raml2html.

I was also searching for a good documentation tool which can be easily integrated into rails. Finally we built our own rails engine APIDOCO
However it does not auto generate the documentation but you can easily use it.

Related

Is there a Rails plugin to help me build an API for ember-data's RESTAdapter? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
So I'm going to embark on a project using ember-data, which tells me
The REST adapter assumes that the URLs and JSON associated with each model are conventional; this means that, if you follow the rules, you will not need to configure the adapter or write any code in order to get started.
Right-o! I want to do that. But what I would like to know is: is there a gem out there to help me build this REST API? If so, I could save time and use it instead of reinventing the wheel myself (and misinterpreting the conventions). Alternatively, I could set about developing such a framework as a separate gem!
So far I've seen
https://github.com/emberjs/ember-rails (seems focused on managing the javascript side and asset pipeline)
https://github.com/dgeb/ember_data_example (more an example app than a framework?)
and neither of them appear to be quite what I'm after. Am I wrong here?
(N.B. please consider me aware of the experimental nature of ember-data and the implications associated with it.)
I haven't tried it but this might be what you want: https://github.com/hedtek/ember-generators
If you're referring to the rails backend look at active model serializers (which I believe is a dependency with the ember-rails gem). And then for your controllers use respond_to :json and in your actions do respond_with <your_active_record_model_or_array_of_models>. Hope that helps.

Complete rails json API example with Rspec tests [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm looking for a good example repository of a Rails 3 project that implements a JSON API and has included RSpec tests. A full tutorial would be great but I'd settle for just a well commented example.
Yehuda Katz and Ryan Bigg's excellent upcoming book, Rails 3 in Action, has a chapter on building a test-driven JSON API on top of the example application that runs through the entire book.
While I strongly recommend buying a copy of the beta edition of the book, the code for the sample application, Ticketee, is open source and can be found on GitHub. In particular, everything API-related is namespaced under /app/controllers/api and you can find plenty of RSpec tests in /spec/api.
I was in your same position a couple of months ago when I was having to write a JSON API for an iPhone app so I'm well aware of the lack of good, test-driven, relevant tutorials online. Lucky for me I found out about the book and it turned out to be an absolute life saver.
RubyGems.org is open source and has a great example of an API
Can't necessarily answer the api example, but I can definitely vouch for the API testing of a rails 3 app in processes.
Here you go: whitneytaylorimura.wordpress.com
It has a full example using Cucumber, Rspec, & FactoryGirl to create your objects (with DatabaseCleaner to clean them up).

Can anyone recommend a beginning Ruby on Rails tutorial that doesn't rely on scaffolding? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've just started learning Ruby on Rails, and all the tutorials and books I've used rely on scaffolding to get started. I've written two simple apps but I still can't figure out how to independently write a database-driven app without using scaffolding, and yet from what I've read online most professional Rails developers don't use it. Are there any tutorials that would help a newbie create their first app without scaffolding?
This one http://net.tutsplus.com/tutorials/ruby/the-intro-to-rails-screencast-i-wish-i-had/ is pretty good and helpful.
"Rails 3 in Action" is a good resource (I've even bought it ;)), one thing I hate about it is a sort of enforced usage of Cucumber.
Cucumber is a great tool, worth mentioning, but it is used all over the book and it clutters the narrative terribly. I would like to have Cucumber-free version of the book and I belive that most beginners would prefer the same.
Ruby on Rails Tutorial by Michael Hartl: http://www.railstutorial.org/
Best resource for Rails learning I've come across, whether in paper or online.
I'm currently writing a book called Rails 3 in Action that sounds like it would "answer" your question.
Whilst the first chapter does cover scaffolding (just for a "quick win"), the rest of the book goes through and teaches you how to develop an application using the exact same process that people in the real world do.
You'll learn Rails, Cucumber and RSpec, along with the other gems that we pick up along the way of developing the application.
Give it a shot and let me know what you think.
Check out some of the older Railscasts.

Using FourSquare API in a Rails App [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Anybody have any good resources that might be helpful in trying to integrate the FourSquare API into a Rails app? I'm specifically looking for a good tutorial. There doesn't seem to be much out there yet. There are a few ruby gems, but they are pretty bare bones and I need a bit more hand-holding.
Here is a resource that I've found so far:
http://tedgrubb.com/
Stack Overflow won't let me include a second hyperlink, but you can also google: Foursquare ruby gem for another resource.
I have not done much work with APIs in the past, but I am very comfortable with Rails. What I need is a little better sense of exactly where all the pieces fit. A basic tutorial is what I'm looking for.
Thanks.
This helped me. It's a working example of a Rails project integrated with FourSquare:
https://github.com/pierrevalade/foursquare-rails-examples
Quimby is an excellent ruby api wrapper:
https://github.com/groupme/quimby
It was built by GroupMe.
'foursquare2' Ruby wrapper for the foursquare v2 API
Refere this : https://github.com/mattmueller/foursquare2 which is good & helped me a lot.
You can able to get more foursquare API data as user less and with authenticated user also
by using the 'foursquare2' gem.
The foursquare-API gem seems like the only one out there that supports V2 of their API and seems like the best place to start.
This isn't an answer, but this may be a start:
http://stakeventures.com/articles/2009/07/21/consuming-oauth-intelligently-in-rails
http://developer.foursquare.com/docs/oauth.html
I'm having trouble implementing a 4sq rails app myself.

Is there anything that explains the Rails' API documentation? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I know that http://api.rubyonrails.org/ is meant to explain methods etc in ruby on rails, but I need something that explains the explanation to me. It seems like a good resource, I'd like to understand it or perhaps it's time to give up.
I think this might be what I was after
Reading the API
I suggest you try some light reading first. Quite a few Rails tutorials exist.
As the URL indicates, this is API documentation. You use it for reference, not for learning about the language or framework. This is not specific to the Rails API, but for just about every framework out there.
I suggest you follow a few Ruby tutorials and then start on a few Rails tutorials first.
http://www.ruby-lang.org/en/ should get you started on Ruby. I won't bother linking to Rails tutorials, but http://railscasts.com/ is an excellent place to start once you get a basic Rails app up and running.
After that, the Rails API will start making a lot more sense.
http://api.rubyonrails.org is definitely not what I would call newbie friendly. Here's some places to go for more information:
railsapi.com -- Same idea but way better presentation, easier to navigate. Use this like you would msdn.com: a reference for things you already know about, but need to look up the particulars.
guides.rubyonrails.org -- This is geared much more towards new users in a tutorial format.
railscasts.com -- Short demonstrations of particular features and plugins in screencast format.
Of course if you have any specific questions about the framework you've already come to the right place.
I recommend at http://www.railsbrain.com and http://railsapi.com/doc/rails-v2.3.5/ as better ways of navigating the docs.
Another good source would be apidock.com
Contains lots of examples on how to use each rails feature.
In addition the same site also provides documentation for Ruby
This one has a lot of good examples: http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-quick-guide.htm

Resources