Commit 900cad88420c1f13a2117e5ba7bba4e0d0607afe
Committed by
Rafael Manzo
1 parent
d405f1a8
Exists in
colab
and in
4 other branches
link to configuration index is working
Showing
3 changed files
with
42 additions
and
0 deletions
Show diff stats
app/controllers/mezuro_configurations_controller.rb
1 | class MezuroConfigurationsController < ApplicationController | 1 | class MezuroConfigurationsController < ApplicationController |
2 | + | ||
3 | + def index | ||
4 | + @configurations = KalibroGem::Entities::Configuration.all | ||
5 | + end | ||
2 | 6 | ||
3 | def show | 7 | def show |
4 | @configuration = MezuroConfiguration.find(params[:id]) | 8 | @configuration = MezuroConfiguration.find(params[:id]) |
@@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
1 | +<div class="page-header"> | ||
2 | + <h1>Configurations</h1> | ||
3 | +</div> | ||
4 | + | ||
5 | +<% if user_signed_in? %> | ||
6 | + <p> | ||
7 | + <%= link_to 'New configuration', new_mezuro_configuration_path, class: 'btn btn-primary' %> | ||
8 | + </p> | ||
9 | +<%else%> | ||
10 | + <p class="alert alert-warning alert-dismissable"> | ||
11 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||
12 | + To create new configurations you must be logged in page. | ||
13 | + </p> | ||
14 | +<% end %> | ||
15 | + | ||
16 | +<%= render partial: 'shared/mezuro_configuration_list', locals: {configurations: @configurations} %> | ||
0 | \ No newline at end of file | 17 | \ No newline at end of file |
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +<table class="table table-hover"> | ||
2 | + <thead> | ||
3 | + <tr> | ||
4 | + <th>Name</th> | ||
5 | + <th>Description</th> | ||
6 | + <th colspan="2"></th> | ||
7 | + </tr> | ||
8 | + </thead> | ||
9 | + | ||
10 | + <tbody> | ||
11 | + <% configurations.each do |configuration| %> | ||
12 | + <tr> | ||
13 | + <td><%= configuration.name %></td> | ||
14 | + <td><%= configuration.description %></td> | ||
15 | + <td><%= link_to 'Show', mezuro_configuration_path(configuration.id), class: 'btn btn-info' %></td> | ||
16 | + <td> | ||
17 | + <%= link_to 'Edit', edit_mezuro_configuration_path(configuration.id), class: 'btn btn-info' %> | ||
18 | + </td> | ||
19 | + </tr> | ||
20 | + <% end %> | ||
21 | + </tbody> | ||
22 | +</table> | ||
0 | \ No newline at end of file | 23 | \ No newline at end of file |