ApiBootstraper/Api-documentation

View on GitHub
app/views/versions/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, "#{@version.name} < REST API" -%>
<% content_for :hero_unit do %>
    <h1>REST Api > <%= "#{@version.name}" %></h1>
<% end %>

<section>
    <div class="page-header">
        <h1>Basics informations</h1>
    </div>

    <div class="row">
        <div class="col-md-2">
            <p>&nbsp;</p>
        </div>

        <div class="col-md-10">
            <p>The <code><%= @version.name %></code> of the API is for the alpha version of the application.</p>
        </div>
    </div> <!-- /.row -->
</section>

<section>
    <div class="page-header">
        <h1>Authentication</h1>
    </div>

    <div class="row">
        <div class="col-md-2">
            <p>&nbsp;</p>
        </div>

        <div class="col-md-10">
            <p>For this version, you must authenticate you for all of services </p>
            <p>For this version, you must be authenticated to use all services, except <span class="label label-success">POST</span><code>/user</code> and <span class="label label-info">GET</span><code>/user/availability</code>.</p>
            <p>The authentication method is the <code>HTTP Basic Auth</code>, with <b>email</b> and <b>password</b>.</p>
        </div>
    </div> <!-- /.row -->
</section>

<section>
    <div class="page-header">
        <h1>List of services</h1>
    </div>

    <div class="row">
        <div class="col-md-2">
            <p>Chose the service you want see</p>
            <% unless @version.changelog.nil? %><p>See: <%= link_to "changelog", :controller => "changelogs", :action => "show", :version => @version.slug %></p><% end %>
        </div>

        <div class="col-md-10">
            <table class="table">
                <tbody>
                    <% @version.resources.order("position ASC").each do |r| %>
                    <tr>
                        <th width="20%"><%= link_to "/#{r.name}", :controller => "resources", :action => "show", :version => @version.slug, :resource => r.slug %></th>
                        <!-- <td width="10%"><div class="progress progress-danger"><div class="bar" style="width: 20%;"></div></div></td> -->
                        <td width="70%"><%= r.description %></td>
                    </tr>
                    <% end %>
                </tbody>
            </table>
        </div>
    </div> <!-- /.row -->
</section>