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.
Related
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.
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 7 years ago.
Improve this question
I'm a Java developer and I really want to get into Rails. What have you found to be the best way to learn RoR?
Seriously, any tips/tricks/rants would be awesome.
I'd definitely recommend using Michael Hartl's Ruby on Rails Tutorial book. I've also found Daniel Kehoe's Learn Ruby on Rails e-book super helpful as well.
On a personal level, finding a project I actually wanted to build, as opposed to just pacing through a tutorial, is what really helped get me off the ground though.
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 8 years ago.
Improve this question
Which one is more futureproof at this point?
Which one is better for creating simple web apps in smallest time?
This also might be a question of JS vs Ruby, what do you think of this?
What are the pros and cons of each?
I suggest you do more google on this topic because it is a very general topic. However these articles offer some comprehensive comparisons:
http://ilikekillnerds.com/2014/07/should-i-use-ruby-on-rails-or-node-js-for-my-next-projectstartup/
http://fabianosoriani.wordpress.com/2011/09/11/when-to-ruby-on-rails-when-to-node-js/
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 8 years ago.
Improve this question
Does anyone know the reason why so many Ajax related tags are being deprecated from Grails? As far as I can tell, there is no replacement other than providing your own Javascript. They seemed like handy features. I'm just curious.
You should look at below link for AJAX tags deprecation.
https://groups.google.com/forum/#!msg/grails-dev-discuss/4yesijtFSB4/PcMs8lF1_mEJ
They will however be moved to a plugin and you should be able to use it.
The main reason for deprecation is here: http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
Hope this helps!
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 8 years ago.
Improve this question
So I am new to rails and just started learning it today. I was wondering what sort of code a programmer would put in the ActiveRecord::Base class. I have a general idea about MVC so I want to know specifically about the Base class not about what I would generally find in the Model.
Thanks. :)
The programmers who create Rails put this into ActiveRecord::Base.
An average programmer who uses Rails (i.e. develops a Rails application) would typically not touch it.