lib/generators/under_construction/constants.rb in under_construction-0.1.4 vs lib/generators/under_construction/constants.rb in under_construction-0.2.1
- old
+ new
@@ -20,18 +20,34 @@
# generated by under_construction gem
resources 'under_construction_email_storage', only: :create
resources 'under_construction', only: :index
EOM
- ROUTES_REDIRECT_TO_TXT = <<-EOM
+ if ::Rails::VERSION::MAJOR >= 4
+ ROUTES_REDIRECT_TO_TXT = <<-EOM
# generated by under_construction gem
+ match "/*other" => redirect("/under_construction"), via: :all
+ EOM
+ else
+ ROUTES_REDIRECT_TO_TXT = <<-EOM
+
+ # generated by under_construction gem
match "/*other" => redirect("/under_construction")
EOM
+ end
- ROUTES_CLEAR_TXT = <<-EOM
+ if ::Rails::VERSION::MAJOR >= 4
+ ROUTES_CLEAR_TXT = <<-EOM
# generated by under_construction gem
+ match "under_construction", :to => redirect('/'), via: :all
+ EOM
+ else
+ ROUTES_CLEAR_TXT = <<-EOM
+
+ # generated by under_construction gem
match "under_construction", :to => redirect('/')
EOM
+ end
end
end