我需要渲染一个可以从多个视图接收一些参数的共享部分,但我不想每次都传递所有参数。如果我在没有所有参数的情况下调用模板,则会出现错误。
有没有办法定义参数的默认值,只有在调用时没有定义它们render 'name_of_partial?
我已经尝试了我能想到的一切,但我无法让部署工作。
该应用程序需要部署到由Alwaysdata托管并运行ruby 2.6.2的VPS,使用Capistrano进行部署。这是一个 Rails 6.0.2.2 应用程序,使用 webpack 处理 JS,使用 sprocket 处理遗留脚本、所有图像和 CSS。
# On local machine (MacOS)
$ bundle exec cap production deploy
00:00 git:wrapper
00:01 git:check
00:03 deploy:check:directories
00:03 deploy:check:linked_dirs
00:03 deploy:check:make_linked_dirs
00:05 git:clone
00:06 git:update
00:08 git:create_release
00:10 deploy:set_current_revision
00:10 deploy:symlink:linked_files
00:12 deploy:symlink:linked_dirs
00:18 deploy:config:bundler
00:20 bundler:install
00:20 deploy:assets:precompile
#<Thread:0x00007fb35ba959f0@/Users/Goulven/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
/Users/Goulven/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/command.rb:97:in `exit_status=': rake exit status: 1 (SSHKit::Command::Failed)
rake stdout: Nothing written
rake stderr: Nothing written
INFO …Run Code Online (Sandbox Code Playgroud)