diff --git a/app/controllers/mezuro_configurations_controller.rb b/app/controllers/mezuro_configurations_controller.rb index 651b4cf..ebe322a 100644 --- a/app/controllers/mezuro_configurations_controller.rb +++ b/app/controllers/mezuro_configurations_controller.rb @@ -1,4 +1,8 @@ class MezuroConfigurationsController < ApplicationController + + def index + @configurations = KalibroGem::Entities::Configuration.all + end def show @configuration = MezuroConfiguration.find(params[:id]) diff --git a/app/views/mezuro_configurations/index.html.erb b/app/views/mezuro_configurations/index.html.erb new file mode 100644 index 0000000..f16d480 --- /dev/null +++ b/app/views/mezuro_configurations/index.html.erb @@ -0,0 +1,16 @@ + + +<% if user_signed_in? %> +

+ <%= link_to 'New configuration', new_mezuro_configuration_path, class: 'btn btn-primary' %> +

+<%else%> +

+ + To create new configurations you must be logged in page. +

+<% end %> + +<%= render partial: 'shared/mezuro_configuration_list', locals: {configurations: @configurations} %> \ No newline at end of file diff --git a/app/views/shared/_mezuro_configuration_list.html.erb b/app/views/shared/_mezuro_configuration_list.html.erb new file mode 100644 index 0000000..1211987 --- /dev/null +++ b/app/views/shared/_mezuro_configuration_list.html.erb @@ -0,0 +1,22 @@ + + + + + + + + + + + <% configurations.each do |configuration| %> + + + + + + + <% end %> + +
NameDescription
<%= configuration.name %><%= configuration.description %><%= link_to 'Show', mezuro_configuration_path(configuration.id), class: 'btn btn-info' %> + <%= link_to 'Edit', edit_mezuro_configuration_path(configuration.id), class: 'btn btn-info' %> +
\ No newline at end of file -- libgit2 0.21.2