-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation conventions
samehmetias edited this page Apr 11, 2014
·
1 revision
Documenting a method in ruby Here are examples of how we should be documenting our methods in ruby and our html files
Ruby methods:
def multiplex(text, count) text * count end
Documenting HTML/JavaScript files Comment at the beginning of important tags indicating the function of that specific tag. Do not document each single tag (e.g tags that start and end on the same line) but tags containing many lines of code
<% @items.each do |item| %>
<%= item.name %> <%= item.price %> <%= item.category %> <%= item.amount %> <%= item.status %> <%= item.description %> <%= item.rating %> <%= link_to 'Show', item %> <%= link_to 'Edit', edit_item_path(item) %> <%= link_to 'Destroy', item, method: :delete, data: { confirm: 'Are you sure?' } %> <%= button_to 'Pause', item %> <%= button_to 'Resume', item %> <% end %>