From 953fd0447dd2492d23c57527e74dd2ad4f29f3f3 Mon Sep 17 00:00:00 2001 From: SouthWolf Date: Sun, 21 Feb 2016 09:38:43 +0800 Subject: [PATCH 1/3] Update for Rails 5: no "Listing on index --- lib/bootscaf/cli.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bootscaf/cli.rb b/lib/bootscaf/cli.rb index 2cc15b7..668538a 100644 --- a/lib/bootscaf/cli.rb +++ b/lib/bootscaf/cli.rb @@ -64,7 +64,7 @@ def nest(nestpath) print `sed #{icmd} -e 's/#{modelname.capitalize} - $/#{modelname.capitalize} - #{singularized_ancestors.last.capitalize} <%= @#{singularized_ancestors.last}.id %>/' app/views/#{modelname}/index.html.erb` print `sed #{icmd} -e 's/.html_safe, "\\/", /.html_safe, [#{singularized_ancestors.map{|sa| "@#{sa}"}.join(', ')}], /' app/views/#{modelname}/index.html.erb` print `sed #{icmd} -e 's/.html_safe, \\[:new, :#{singular_modelname}\\], /.html_safe, [:new, #{singularized_ancestors.map{|sa| "@#{sa}"}.join(', ')}, :#{singular_modelname}], /' app/views/#{modelname}/index.html.erb` - print `sed #{icmd} -e 's/Listing #{modelname.capitalize}$/Listing #{modelname.capitalize}\\\n #{singularized_ancestors.last.capitalize} <%= @#{singularized_ancestors.last}.id %><\\/small>/' app/views/#{modelname}/index.html.erb` + print `sed #{icmd} -e 's/#{modelname.capitalize}$/#{modelname.capitalize}\\\n #{singularized_ancestors.last.capitalize} <%= @#{singularized_ancestors.last}.id %><\\/small>/' app/views/#{modelname}/index.html.erb` print `sed #{icmd} -e 's/data-href="<%= #{singular_modelname}_path(#{singular_modelname}) %>"/data-href="<%= polymorphic_path([#{singularized_ancestors.map{|sa| "@#{sa}"}.join(', ')}, #{singular_modelname}]) %>"/' app/views/#{modelname}/index.html.erb` print `sed #{icmd} -e 's/, #{singular_modelname} %><\\/td>/, [#{singularized_ancestors.map{|sa| "@#{sa}"}.join(', ')}, #{singular_modelname}] %><\\/td>/' app/views/#{modelname}/index.html.erb` @@ -220,7 +220,7 @@ def update(modelname = nil) print "Updating app/views/#{modelname}/index.html.erb. " print `sed #{icmd} -e 's/

<%= notice %><\\/p>//' app/views/#{modelname}/index.html.erb` - print `sed #{icmd} -e 's/

Listing \\(.*\\)s<\\/h1>/<% content_for :page_title do %>\\\n\\1s - \\\n<% end %>\\\n
\\\n