diff options
| author | jpl | 2016-10-07 15:50:37 +0200 |
|---|---|---|
| committer | jpl | 2016-10-07 15:50:37 +0200 |
| commit | 53099780076f7d5d11155900473c3452bd731a64 (patch) | |
| tree | b9509c43bbaca117c61ad18fb1e6e7edce2e7ba7 | |
| parent | 15523ffde84e85595224c3b5ecd7e6fa28256ca4 (diff) | |
| download | chouette-core-53099780076f7d5d11155900473c3452bd731a64.tar.bz2 | |
adding link builder to table builder
| -rw-r--r-- | app/helpers/refobjects_helper.rb | 6 | ||||
| -rw-r--r-- | app/views/companies/_companies.html.slim | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/refobjects_helper.rb b/app/helpers/refobjects_helper.rb index 8dbc2bc07..cc3580372 100644 --- a/app/helpers/refobjects_helper.rb +++ b/app/helpers/refobjects_helper.rb @@ -32,17 +32,17 @@ module RefobjectsHelper actions.each do |action| if action == "show" - showlink = link_to({controller: params[:controller], action: action, id: item.id}, class: 'btn btn-default') do + showlink = link_to({controller: params[:controller].to_s, action: action, id: item.id}, class: 'btn btn-default') do content_tag :span, "", class: 'fa fa-eye' end link << showlink elsif action == "edit" - editlink = link_to({controller: params[:controller], action: action, id: item.id}, class: 'btn btn-default') do + editlink = link_to({controller: params[:controller].to_s, action: action, id: item.id}, class: 'btn btn-default') do content_tag :span, "", class: 'fa fa-pencil' end link << editlink elsif action == "delete" - deletelink = link_to({controller: params[:controller], action: "show", id: item.id}, method: :delete, data: { confirm: 'Are you sure?'}, class: 'btn btn-default') do + deletelink = link_to({controller: params[:controller].to_s, action: "show", id: item.id}, method: :delete, data: { confirm: 'Are you sure?'}, class: 'btn btn-default') do content_tag :span, "", class: 'fa fa-trash-o' end link << deletelink diff --git a/app/views/companies/_companies.html.slim b/app/views/companies/_companies.html.slim index af7f6d48f..a83b3bada 100644 --- a/app/views/companies/_companies.html.slim +++ b/app/views/companies/_companies.html.slim @@ -4,7 +4,8 @@ .companies.paginated_content style="margin-top:20px;" = table_builder CompanyDecorator.decorate_collection(@companies), - [:name, :edited_at, :published_at, :validity_period, :linecount, :transporter, :status] ["show", "delete"], + [:name, :edited_at, :published_at, :validity_period, :linecount, :transporter, :status], + ["show", "delete"], 'table table-bordered' .pagination |
