Is Rails controller documentation a best practice? [closed] - ruby-on-rails

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Reek gem identifies a smell in my code such that it lacks documentation in classes. But I was wondering if that should be applied to controllers as well.
In a good codebase, a controller would be very thin, just dealing with the requests and delegating all the logic to models/services/helpers. Hence not much to document to begin with. Not being an API and especially not an open one, I don't see a good reason to add documentation to it.
Would like to hear your opinion on this.

In my opinion, there is no need for documentation in controllers. But if you want reek to not identify this smell then you can add a one-liner explanation of the controller or add
#:nodoc: all
at the top in your controllers (this is what I do). This is suggested by rubycop gem
Hope this helps.

Related

What does “consume an API” means? With details, please [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I would like to know what "consume an API" means in a less technical language possible and would like too some simple example in git and, if possible, using Ruby. I understand that I may be asking a lot, sorry for that, but I can not understand 100% of the examples I found.
I can not go on, because I have not yet been able to fully understand the subject.
Example:
I have a application, a CRUD simple and a API isa JSON that extract the results this CRUD?
Sorry for my limited understanding. I would very much like details with code example, just something basic.
It means that you take in data from an external source/url and do something with it. Here is an example:
http://www.theodinproject.com/courses/ruby-programming/lessons/file-i-o-and-serialization

difference between fullcalendar-engine-rails fullcalendar-rails gem [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Does sby know what's the main difference between the fullcalendar-rails and the fullcalendar-engine-rails gem? I don't know which one I should pick.
Looks like the engine version depends upon the non-engine one... Just looking at the readmes:
https://github.com/bokmann/fullcalendar-rails
this is a rails implementation of the jquery plugin.
It lets you add the js into your asset pipeline by adding the gem to your gemfile instead of copy/pasting js into your app
https://github.com/vinsol/fullcalendar-rails-engine
This seems to be an engine implementation of the above - it appears to give you some nicer convenience methods on top of just bringing in the js.
Note: this is from a quick google and 30 seconds of skimming the readmes... I suggest you read them yourself to get more info.
As to "which one to choose"... can't help you if you don't tell us what you need it for. (also that's probably a bit beyond the scope of an S/O question.

Rails best practices [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Can anyone help me with few indication about best way to do few things.
At this point I am in a situation where I have a task(.rake), and the code become so ugly that I need to split it out. So if I will create another file, probably a module with multiple classes and methods or just methods, where should I put the file (libs probably?)? (this file may be used by models as well). Also if I want to do the same or a module?
Any books, tutorials, articles, and opinions are welcomed.
Thank you
Check out the Rails Guides for an introduction - beyond that, there are many different [opinionated] resources on the matter, ie:
Railscasts

Building a Code Generator in ruby.. Where to start? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've been thinking about starting an open source admin panel for rails using the cappuccino JavaScript / Objective-J web framework..
How would I get started?
Are there any resources you can point me to, that explain dynamic scaffolding like code generation?
Thanks and looking forward to collaborating if anyones interested?
Daniel
You may want to take a look # rails_admin. It is a port of Merb Admin. It's still pretty young, but may give you ideas on the approach.
ActiveScaffold has been around for a while too which may be another good reference project.

conventions for rails app documentation? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I known that it's more a state of art than a technical question, but I'm looking for some good templates to document model relation, validations, method for the models and controllers of my rails app.
Are there any conventions/best practice/examples to do that ?
Thanks all for your help
You can use RDoc to self-document your code. It'll take your code comments and make documentation for your project.
http://rdoc.rubyforge.org/
http://en.wikibooks.org/wiki/Ruby_Programming/RubyDoc
It's pretty neat.
I'm not sure there's much use in documenting validations and relations... Your Ruby source code is already incredibly readable in that regard.

Resources